Splunk Search

How to create a new _time field by merging two separate fields

dailv1808
Path Finder

I have a sample event log below:

2018-05-04 06:59:50 AAA="1", BBB="2", CCC="3", XXX="70029", ZZZ="2018-05-04 00:00:00"

Splunk will automatically get "2018-05-04 06:59:50" for _time field. But i want the _time field will be created by XXX and ZZZ fields.
like this: _time = "2018-05-04 7:00:29"
Note that I haven't permission to access to props.conf file. So how can i do it.

Any suggestion is welcomed!
Thank for advance!

0 Karma

HiroshiSatoh
Champion

You can set _time in the search sentence.

| makeresults |eval  XXX="70029", ZZZ="2018-05-04 00:00:00"
| eval bk_time=_time
| eval _time=strptime(substr(ZZZ,0,10)+":"+substr("0"+XXX,len("0"+XXX)-5,6),"%Y-%m-%d:%H%M%S")
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...