Getting Data In

timestamp extraction from two places during index time within an event

ankithreddy777
Contributor

I have an event like

"abcabcabc....abc.........time:-2017-05-05T0*8:08:08.987........abcxyz...abcxyz.....date:-2017-05-03*......"

I need to assign timestamp to each event at index time only , where date should be extracted from date field above and time value should be extracted from timestamp field.

Is there any possibility.
If I need to use datatime_renamed.xml . May I know what changes to be made in file?

Tags (1)
0 Karma

niketn
Legend

@ankithreddy777, if time:-2017-05-05T* prefixes the time which you want Splunk to pick and also the date that you want to avoid you can use TIME_PREFIX regex to skip this.

Try the following props.conf settings (where 57 is number for characters to look ahead in order to find date. Based on sample data it is ........abcxyz...abcxyz.....date:-. You can change 57 to a different number based on actual estimated number of characters.

TIME_PREFIX=time:-\d{4}-\d{2}-\d{2}T\d*
MAX_TIMESTAMP_LOOKAHEAD=57
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

SuryaNittala
New Member

Can you paste the sample event. You can achieve this by configuring TIME_PREFIX and MAX_TIMESTAMP_LOOKAHEAD in props.conf

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...