Skip to content

Instantly share code, notes, and snippets.

@anaynayak
Created November 29, 2016 14:07
Show Gist options
  • Save anaynayak/8fd55a096530e146466525f13f351b9a to your computer and use it in GitHub Desktop.
Save anaynayak/8fd55a096530e146466525f13f351b9a to your computer and use it in GitHub Desktop.
{
"sn": {
"title": "sn log format",
"description": "Log format",
"url": "http://lnav.readthedocs.io/en/latest/formats.html",
"regex": {
"basic": {
"pattern": "^\\[(?<timestamp>\\d{6} \\d{2}:\\d{2}:\\d{2}) ~ (?<level>\\w+)\\] \\[(?<status>\\d*) (?<verb>\\w*) \"(?<url>.*)\" .*?\\] (?<time>\\d*)ms \\((?<user>.*)\\) (?<detail>.*)$"
}
},
"level-field": "level",
"level": {
"error": "ERROR",
"warning": "WARNING",
"info": "INFO",
"debug": "DEBUG"
},
"timestamp-format": [
"%y%m%d %H:%M:%S"
],
"value": {
"user": {
"kind": "string",
"identifier": true
},
"url": {
"kind": "string",
"identifier": true
},
"time": {
"kind": "integer",
"identifier": true
},
"status": {
"kind": "integer",
"identifier": true
},
"verb": {
"kind": "string",
"identifier": true
}
},
"sample": [
{
"line": "[160928 07:44:26 ~ DEBUG] [200 PUT \"/myapi/blah\" HTTP/1.1] 1815ms (myuser) (undefined)"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment