Installations
npm install logentries-query-cli
Developer Guide
Typescript
No
Module System
N/A
Min. Node Version
>=6
Node Version
6.9.2
NPM Version
5.0.1
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
walling
Download Statistics
Total Downloads
972
Last Day
2
Last Week
4
Last Month
10
Last Year
90
GitHub Statistics
1 Stars
6 Commits
3 Watching
1 Branches
2 Contributors
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
972
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
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
Content
Install
To install globally:
1npm install -g logentries-query-cli
The command is called logentries-query
. You can optionally setup an alias.
Initial Setup
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.
API
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.
Command-line arguments
Here are the supported command line arguments.
log
The --log=alias
argument specifies which logs to query. You can specify one or more logs. Example:
1logentries-query --log=foo --log=bar 'query'
time
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'
start
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'
end
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'
utc
The --utc
argument forces all timestamps to be UTC time. This means the parsing of timestamps defaults to UTC as well as outputting timestamps.
format
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 key
show-time
The --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.
log-name
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.
no-log-name
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.
limit
The --limit
argument specifies the maximum number of records to return for each log. This can lead to a more efficient query time.
Alias
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'
License
Code is licensed under MIT, please see license.md file for details.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: license.md:0
- Info: FSF or OSI recognized license: MIT License: license.md:0
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
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
22 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2
- Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq
- Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm
- Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3
- Warn: Project is vulnerable to: GHSA-446m-mv8f-q348
- Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4
- Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3
- Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7
- Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.7
/10
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