Hi folks,
I have a use case where I am having different types of events in a single sourcetype. I want to apply different timestamp extractions for both the events.
I am using TIME_PREFIX and MAX_TIMESTAMP_LOOKAHEAD to extract the timestamp from event #1. However, the same rules won't be useful for event #2.
Is there a way to extract the timestamp values from both the events in a single sourcetype?
Event #1 Timestamp should be extracted as (Oct 9 23:57:37.887)
Oct 10 05:27:48 192.168.100.1 593155: *Oct 9 23:57:37.887: blah blah blah
Event #2 Timestamp should be extracted as (Feb 13 11:27:46)
Feb 13 11:27:46 100.80.8.22 %abc-INFO-000: blah blah blah
TIME_PREFIX = \s[^\s]+\s\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\s[^\s]+:\s|\s[^\s]+\s\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\s
MAX_TIMESTAMP_LOOKAHEAD = 30
Hi @darshm ,
if you're sure that in your events there's only one date and time, you could leave Splunk to choose the timestamp, but, my hint is the same of @ITWhisperer : different formats should have different sourcetypes, eventually with a similar name (e.g. for fortinet there are fortigate_events, fortigate_logs, fortigate_utm, etc...).
Ciao.
Giuseppe
The short answer is that the different log formats should be in different sourcetypes.