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!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...