AWS CloudWatch Logs Insights is wrapped by Python
Project description
PyInsights
A CLI tool To query CloudWatch Logs Insights.
ToC
Usage
Write Configuration
Write configuration to pyinsights.yml
like:
version: '1.0'
log_group_name:
- '/ecs/sample'
query_string: 'field @message | filter @message like /ERROR/'
duration: '30m'
limit: 10
I wrote examples, so see examples folder.
Execute command
pyinsights -c pyinsights.yml -p aws_profile -r region
Configuration
Parameter | Type | Required | Description |
---|---|---|---|
version | string | true | Choose configuration version from ['1.0'] |
log_group_name | array | true | Target log group names to query |
query_string | string | true | Pattern to query |
duration | string or object | true | |
string | Specify hours, minutes or seconds from now Unit: hours = h ,minutes = m ,seconds = s ,days = d ,weeks = w |
||
object | Specify start_time and end_time Datetime format must be YYYY-MM-DD HH:MM:SS |
||
limit | integer | false | The number of log to fetch |
CLI Options
Option | Required | Description |
---|---|---|
-c, --config | true | Specify yaml configuration by absolute or relative path |
-f, --format | false | Choose from json or table |
-p, --profile | false | AWS profile name |
-r, --region | false | AWS region |
-q, --quiet | false | Suppress progress message |
-v, --version | false | Show version |
Environment Variable
If profile
and region
options are not specified, AWS Credentials must be set as environment variables.
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_DEFAULT_REGION
Please see Environment Variable Configuration for the detail.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyinsights-0.3.2.tar.gz
(10.2 kB
view hashes)
Built Distribution
pyinsights-0.3.2-py3-none-any.whl
(11.3 kB
view hashes)
Close
Hashes for pyinsights-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 408b29c684f18165c9600429f70b4339519c400465d7decfb52e7c8dc984557d |
|
MD5 | 442ed551316332fa6d259c489be320f2 |
|
BLAKE2b-256 | b6c299055ae3d1d65de10d4fe8f54f03ad72614518028d6287c910a90a03e20e |