
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
redis-key-scanner
Advanced tools
Scan redis servers looking for key patterns and activity characteristics
Scan a redis server for keys matching specified criteria, including key patterns, TTL and IDLETIME. Selected/matched keys are output in a JSON log format. The scan is non-destructive, and doesn't even read any actual key values.
Note that if you are checking TTL times, due to an acknowledged bug in Redis, this will actually reset the IDLETIME to 0 for the selected keys, so subsequent scans may not return the same results.
Example command-line usage, querying a locally running redis server for keys that start with the prefix "mykeys:" and have been idle (ie., not written or read) for at least one week:
> npm install -g redis-key-scanner
> redis-key-scanner localhost --pattern=mykeys:* --min-idle=1w
Output will be one JSON line per selected key, followed by a "summary" line with total stats:
{"name":"localhost:6379","key":"mykeys:larry","idletime":604800}
{"name":"localhost:6379","key":"mykeys:curly","idletime":900000}
{"name":"localhost:6379","key":"mykeys:moe","idletime":1000000}
{"keysScanned":17,"keysSelected":3,"host":"localhost","port":6379,"scanBatch":1000,"scanLimit":null,"limit":null,"pattern":"mykeys:*"}
You can alternatively require redis-key-scanner
as a Node.js module, in which case it implements a
stream interface and each record will be emitted as a separate 'data' event.
const RedisKeyScanner = require('redis-key-scanner');
const scanner = new RedisKeyScanner({
host: 'localhost',
pattern: 'mykeys:*',
minIdle: '1w'
});
scanner.on('data', (data) => {
console.log(data);
});
scanner.on('end', () => {
// clean up
});
Run redis-key-scanner
to see the full list of available options.
FAQs
Scan redis servers looking for key patterns and activity characteristics
The npm package redis-key-scanner receives a total of 7 weekly downloads. As such, redis-key-scanner popularity was classified as not popular.
We found that redis-key-scanner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.