2
I am working on adding a lnav format to parse the logs of my companies java application. I am running into difficulty getting lnav to recognize them. Here is what my json format file looks like so far:
{
"company_serverlog" : {
"title" : "Company Server Log",
"description" : "Log format used by the application.",
"url" : "http://www.google.com",
"regex" : {
"std" : {
"pattern" : "^(?<timestamp>\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d,\\d\\d\\d)\\|(?<level>DEBUG|ERROR|WARN|HEADER)\\|(?<orig>.+:)\\|(?<method>.+\\|)(?<body>.+)$"
}
},
"level-field" : "level",
"level" : {
"error" : "ERROR",
"warning" : "WARN"
},
"value" : {
"orig" : {
"kind" : "string",
"identifier" : true
},
"method" : {
"kind" : "string",
"identifier" : true
},
"body" : {
"kind" : "string",
"identifier" : true
}
},
"sample" : [
{
"line" : "2016-05-25 16:07:12,367|DEBUG|source of log msg:|com.company.package.file| Log message body here"
}
]
}
}
lnav is still picking up our log files as generic log files. Any assistance and/or recommendations would be greatly appreciated.
It might also help others in future to go into what/where the correct regex bits were – Journeyman Geek – 2016-06-14T23:59:58.137
Thanks for the critique. I edited the 'answer' to reflect your suggestions – Andrew – 2016-06-15T17:09:17.123