Gathering detailed insights and metrics for logentries-query-cli
Gathering detailed insights and metrics for logentries-query-cli
npm install logentries-query-cli
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
972
Last Day
2
Last Week
4
Last Month
10
Last Year
90
1 Stars
6 Commits
3 Watching
1 Branches
2 Contributors
Latest Version
0.1.1
Package Id
logentries-query-cli@0.1.1
Size
6.33 kB
NPM Version
5.0.1
Node Version
6.9.2
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
100%
4
Compared to previous week
Last month
66.7%
10
Compared to previous month
Last year
1.1%
90
Compared to previous year
Command-line tool to stream logs from Logentries
This tool enables you to query log records in Logentries emitted as lines that you can further process by other command-line tools. Example:
1logentries-query --log=my_log --time=20min '/error/i' | grep http_status
To install globally:
1npm install -g logentries-query-cli
The command is called logentries-query
. You can optionally setup an alias.
Before using it, you have to configure the accounts and logs you want to access. In your home directory, you should create a folder named .logentries-query-cli
with a file called config.json
. If in doubt of the path, the command-line tool will output the absolute path, the first time it is run.
The config file should look like this:
1{ 2 "accounts" : { 3 "00000000-0000-0000-0000-000000000000" : { 4 "My_Log_Set" : { 5 "my_log_1" : "foo", 6 "my_log_2" : "bar", 7 "my_log_3" : true 8 }, 9 "Another_Log_Set" : { 10 "my_log_4" : true, 11 "my_log_5" : "baz", 12 "my_log_6" : false 13 } 14 } 15 } 16}
The accounts
object holds each Account Key (you find it in the user settings dashboard). Under each account key, you have log sets (either the UUID or exact name). An under each log set, you have logs (either the UUID or exact name). Each log can be assigned an alias. If you specify true
, it will use the name of the log. If you specify false
, the log will not be included. This can be used to temporarily disable logs.
In the above example you can access my_log_1
as foo, my_log_2
as bar, my_log_5
as baz, my_log_3
/my_log_4
under their own names, and my_log_6
is not available. If in doubt, you can run the tool without any arguments, to list the configured logs.
The config allows you to specify multiple accounts, multiple log sets, and multiple logs. However the minimum requirement is to just specify a single log.
If you want to query logs in a Node.js project, check out the logentries-query-stream
module. This command-line tool is built on that module.
Here are the supported command line arguments.
The --log=alias
argument specifies which logs to query. You can specify one or more logs. Example:
1logentries-query --log=foo --log=bar 'query'
The --time
argument specifies a duration to search for. On its own it searches back in time until now. For example --time=3d
searches 3 days back in time, whereas --time=30sec
searches 30 seconds back in time. Example:
1logentries-query --log=foo --log=bar --time=14d 'query'
The duration is parsed using parse-duration
module, which supports many units.
If you also specify --start
and/or --end
arguments, the behavior changes slightly to define the full duration (either from start or until end). Example:
1logentries-query --log=foo --log=bar --start=2017-06-12 --time=3d 'query'
The --start
argument specifies a start time to search from. The format can be anything that moment
supports.
Together with --time
this specifies an actual duration (from start
plus time
). Example:
1logentries-query --log=foo --log=bar --start=2017-06-12 --time=3d 'query'
The --end
argument specifies an end time to search until. The format can be anything that moment
supports.
Together with --time
this specifies an actual duration (for time
until end
). Example:
1logentries-query --log=foo --log=bar --time=3d --end=2017-06-15 'query'
You can fix the range by combinding --start
and --end
like this:
1logentries-query --log=foo --log=bar --start=2017-06-12 --end=2017-06-15 'query'
The --utc
argument forces all timestamps to be UTC time. This means the parsing of timestamps defaults to UTC as well as outputting timestamps.
The --format
argument specifies how to output the log records. The default format to use is %m
. However you can display the timestamp by using --show-time
. Example:
1logentries-query --log=foo --log=bar --format='[%t] %m (%S/%L)' 'query'
Available specifiers:
%m
- message of the log record%t
- timestamp when the log record was received%l
- log name (alias)%L
- log name from Logentries%S
- log set name%A
- account keyThe --show-time
argument shows the timestamp for each log record. This changes the default output format to %t %m
. However if you specify a custom format, this argument does not have any impact.
The --log-name
argument shows the log name of each log record. This is the default if querying multiple logs. However, with this argument you can always enable it.
The --no-log-name
argument suppresses the log name to be automatically shown. In case you query multiple logs, the default is to include the log name. However, with this argument you can always disable it.
The --limit
argument specifies the maximum number of records to return for each log. This can lead to a more efficient query time.
If you use this tool a lot, you can set up an alias, like this (in your .bashrc
/.zshrc
/etc.):
1alias lq=logentries-query
You can also define aliases to query specific logs:
1alias lq-mylog='logentries-query --log=my_log'
Code is licensed under MIT, please see license.md file for details.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/6 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
no SAST tool detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
22 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More