Skip to content

Commit

Permalink
Create Loki.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lwindolf authored Jul 12, 2024
1 parent 49e3642 commit a53a4fe
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Cheat Sheets/kubernetes/Loki.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Log Query Examples

Convert log string to json

{label="match"} | json

Reduce log lines to exception names

{label="match"} |~ "Exception:" | json | line_format `{{ regexReplaceAll ".*\\s+(\\S*Exception):.*$" .message "${1}" }}`

Reduce log lines to exception names (without regex)

{label="match"} |~ "Exception:" | json | regex(.message, '.*\\s+(\\S*Exception):')

0 comments on commit a53a4fe

Please sign in to comment.