HI All,
I`m getting syslogs from 2 different devices, which there is slight vary in the data due to which i`m not able to parse both logs in the same query as either 1 will give “data” & other will show as “null”
I`m looking for output for the field “category” but unable to parse both at the same time in single query but able to get the desired output on separate queries.
1) content in syslog example as below where “Category” field is in middle and if i use “,” getting the desired output on this case
Sample Raw log
Initiator=Source, Category=block, Client=application
fetch logs
| parse content, “”" DATA ‘,’ MOF LD “Category” PUNCT ld:Category ‘,’ “”"
>>Output for Category field is
block
2) content in syslog example as below where its ending with “Category:block” so if i use ‘,’ its returning as null,Since there is no “,” parameter for the “Category” field . So in parse content if left it as empty then output is returning as expected a below
Initiator:Source, Category:block
fetch logs
| parse content, “”" DATA ‘,’ MOF LD “Category” PUNCT ld:Category"“”
>>Output for Category field is
block
I want both conditions to be parsed in same query, with some conditional parameters
And the field “Category” consists other values such as “block” or “Geo block” or “geo-state_block” with the special characters inbetween like "space,-,_ ".
I`m using PUNCT here as common to ignore “:” and “=” as both logs are from different devices logs
So i want the output for the category field for different syslogs in same query without loosing any data,
Kindly advise.