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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...