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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...