AWS Classroomnotes 25/Dec/2021

Log Insights Queries

  • Extracting fields from message using parse
fields @timestamp, @message
| parse @message "* - - [*] \"* * \"" as clientip, generated_time, request, other
| sort @timestamp desc

  • Further fields
fields @timestamp, @message
| parse @message "* - - [*] \"* / *\" * * * " as clientip, generated_time, request, http, statuscode, size, other
| sort @timestamp desc


* In the log analytics we can use some functions
* Lets get started from stats

* The above query returns a time series data
* Query to show only valid ip addresses responses

fields @timestamp, @message
| parse @message "* - - [*] \"* / *\" * * * " as clientip, generated_time, request, http, statuscode, size, other
| filter isValidIp('clientip')
| display clientip, statuscode
| sort @timestamp desc
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%