-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing based on new line and delimiter #308
Comments
Hi @dpkkumar01 , Yes, you can use Rsyslog with Liblognorm to parse your message. You will need three files:
Given
, rule file
and input log file:
then Rsyslog will output to {"@version":"1","@timestamp":"2018-10-11T17:20:25.369215+00:00","host":"cd27d80528c2","type":"syslog","syslog_timestamp":"Oct 11 17:20:25","syslog_hostname":"cd27d80528c2","syslog_program":"multilos","syslog_message":"************************************************************\\nRecordType:Submit\\nRecepientID:2328288id23\\nMediaTypes:image\/jpeg,image\/jpeg,image\/jpeg,application\/smil\\nMediaSizes:31214,31900,31214,364\\nContentType:multipart\/related","received_at":"2018-10-11T17:20:25.369215+00:00","received_from":"","logi:":{ "contentType": "ContentType:multipart\/related", "mediaSizes": "31214,31900,31214,364", "mediaTypes": "image\/jpeg,image\/jpeg,image\/jpeg,application\/smil", "recepientID": "2328288id23", "recordType": "Submit" }}
{"@version":"1","@timestamp":"2018-10-11T17:20:25.369279+00:00","host":"cd27d80528c2","type":"syslog","syslog_timestamp":"Oct 11 17:20:25","syslog_hostname":"cd27d80528c2","syslog_program":"multilos","syslog_message":"************************************************************\\nRecordType:Submit\\nRecepientID:2328232id23\\nMediaTypes:image\/jpeg,image\/jpeg,image\/jpeg,application\/smil\\nMediaSizes:31214,31900,31214,364\\nContentType:multipart\/related","received_at":"2018-10-11T17:20:25.369279+00:00","received_from":"","logi:":{ "contentType": "ContentType:multipart\/related", "mediaSizes": "31214,31900,31214,364", "mediaTypes": "image\/jpeg,image\/jpeg,image\/jpeg,application\/smil", "recepientID": "2328232id23", "recordType": "Submit" }}
{"@version":"1","@timestamp":"2018-10-11T17:20:25.369415+00:00","host":"cd27d80528c2","type":"syslog","syslog_timestamp":"Oct 11 17:20:25","syslog_hostname":"cd27d80528c2","syslog_program":"multilos","syslog_message":"************************************************************\\nRecordType:Submit\\nRecepientID:23282353id23\\nMediaTypes:image\/jpeg,image\/jpeg,image\/jpeg,application\/smil\\nMediaSizes:31214,31900,31214,364\\nContentType:multipart\/related","received_at":"2018-10-11T17:20:25.369415+00:00","received_from":"","logi:":{ "contentType": "ContentType:multipart\/related", "mediaSizes": "31214,31900,31214,364", "mediaTypes": "image\/jpeg,image\/jpeg,image\/jpeg,application\/smil", "recepientID": "23282353id23", "recordType": "Submit" }} Pretty printed output for legibility: {
"@version": "1",
"@timestamp": "2018-10-11T17:20:25.369215+00:00",
"host": "cd27d80528c2",
"type": "syslog",
"syslog_timestamp": "Oct 11 17:20:25",
"syslog_hostname": "cd27d80528c2",
"syslog_program": "multilos",
"syslog_message": "************************************************************\\nRecordType:Submit\\nRecepientID:2328288id23\\nMediaTypes:image\/jpeg,image\/jpeg,image\/jpeg,application\/smil\\nMediaSizes:31214,31900,31214,364\\nContentType:multipart\/related",
"received_at": "2018-10-11T17:20:25.369215+00:00",
"received_from": "",
"logi:": {
"contentType": "ContentType:multipart\/related",
"mediaSizes": "31214,31900,31214,364",
"mediaTypes": "image\/jpeg,image\/jpeg,image\/jpeg,application\/smil",
"recepientID": "2328288id23",
"recordType": "Submit"
}
}
{
"@version": "1",
"@timestamp": "2018-10-11T17:20:25.369279+00:00",
"host": "cd27d80528c2",
"type": "syslog",
"syslog_timestamp": "Oct 11 17:20:25",
"syslog_hostname": "cd27d80528c2",
"syslog_program": "multilos",
"syslog_message": "************************************************************\\nRecordType:Submit\\nRecepientID:2328232id23\\nMediaTypes:image\/jpeg,image\/jpeg,image\/jpeg,application\/smil\\nMediaSizes:31214,31900,31214,364\\nContentType:multipart\/related",
"received_at": "2018-10-11T17:20:25.369279+00:00",
"received_from": "",
"logi:": {
"contentType": "ContentType:multipart\/related",
"mediaSizes": "31214,31900,31214,364",
"mediaTypes": "image\/jpeg,image\/jpeg,image\/jpeg,application\/smil",
"recepientID": "2328232id23",
"recordType": "Submit"
}
}
{
"@version": "1",
"@timestamp": "2018-10-11T17:20:25.369415+00:00",
"host": "cd27d80528c2",
"type": "syslog",
"syslog_timestamp": "Oct 11 17:20:25",
"syslog_hostname": "cd27d80528c2",
"syslog_program": "multilos",
"syslog_message": "************************************************************\\nRecordType:Submit\\nRecepientID:23282353id23\\nMediaTypes:image\/jpeg,image\/jpeg,image\/jpeg,application\/smil\\nMediaSizes:31214,31900,31214,364\\nContentType:multipart\/related",
"received_at": "2018-10-11T17:20:25.369415+00:00",
"received_from": "",
"logi:": {
"contentType": "ContentType:multipart\/related",
"mediaSizes": "31214,31900,31214,364",
"mediaTypes": "image\/jpeg,image\/jpeg,image\/jpeg,application\/smil",
"recepientID": "23282353id23",
"recordType": "Submit"
}
} I hope this helps, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the following log pattern in my system & i would like to know is there any option to parse this message using liblognorm
Log Format:
RecordType:Submit
RecepientID:2328288id23
MediaTypes:image/jpeg,image/jpeg,image/jpeg,application/smil
MediaSizes:31214,31900,31214,364
ContentType:multipart/related
RecordType:Submit
RecepientID:2328232id23
MediaTypes:image/jpeg,image/jpeg,image/jpeg,application/smil
MediaSizes:31214,31900,31214,364
ContentType:multipart/related
RecordType:Submit
RecepientID:23282353id23
MediaTypes:image/jpeg,image/jpeg,image/jpeg,application/smil
MediaSizes:31214,31900,31214,364
ContentType:multipart/related
Image:
The text was updated successfully, but these errors were encountered: