Hi
Thank you for the earlier help, iam progressing in good way.
Iam going here is more granular logging and get more information for statistic purpose, at the same time i would like retain some message as it is for user to view.
Now i have 2 queries
Log messages :
Sep 19 03:53:51 DHCP-CA-DNS %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
Grok Pattern :
%{SYSLOGTIMESTAMP:syslog_timestamp} %{HOSTNAME:device_src} %{GREEDYDATA:syslog_message}
Output :
{
** "syslog_timestamp": "Sep 19 03:53:51",**
** "syslog_message": "%LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up",**
** "device_src": "DHCP-CA-DNS"**
}
all good so far.
When i go granular i am breaking my syslog_message. breaks in to different data as expected, that is good.
Log :
Sep 19 03:53:51 DHCP-CA-DNS %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
Grok :
%{SYSLOGTIMESTAMP:syslog_timestamp} %{HOSTNAME:device_src} %%{CISCO_REASON:facility}-%{INT:severity_level}-%{CISCO_REASON:facility_mnemonic}: %{GREEDYDATA:syslog_message}
Output :
{
** "syslog_timestamp": "Sep 19 03:53:51",**
** "severity_level": "5",**
** "syslog_message": "Line protocol on Interface Ethernet0/0, changed state to up",**
** "facility": "LINEPROTO",**
** "facility_mnemonic": "UPDOWN",**
** "device_src": "DHCP-CA-DNS"**
}
but iam looking as below :
{
"syslog_timestamp": "Sep 19 03:53:51",
"severity_level": "5",
"syslog_message1": "Line protocol on Interface Ethernet0/0, changed state to up",
"facility": "LINEPROTO",
"facility_mnemonic": "UPDOWN",
"device_src": "DHCP-CA-DNS"
"syslog_message" : %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up"
}
How can i achieve this ?
appreciate your help.