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!

Splunk Smartness with Brandon Sternfield | Episode 3

Hello and welcome to another episode of "Splunk Smartness," the interview series where we explore the power of ...

Monitoring Postgres with OpenTelemetry

Behind every business-critical application, you’ll find databases. These behind-the-scenes stores power ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...