Splunk Search

Merge cells together when having one same Value

lslschr
Engager

Hello Together

I have a little difficulty with the merging of cells. The idea is that if the results for the value JobID in the table have the same value, the entries for Start Time and End Time should be merged.

 

 

 

index=MYINDEX host=MYHOST sourcetype=regway:server status=COMPLETED
| eval "End Time"=strftime(_time,"%c") 
| append [ search index=MYINDEX host=MYHOST sourcetype=MYINDEX:server "Created metadata export job with id:" 
| rex "id: (?<JobID>\w{1,}-\w{1,}-\w{1,}-\w{1,}-\w{1,})" 
| eval "Start Time"=strftime(_time,"%c")]
| sort JobID
| table "Start Time", "End Time" , JobID

 

 

 

My Result looks currently like this: 
search_splunk_today.png

 

Labels (1)
0 Karma
1 Solution

lslschr
Engager

just found out the answer after testing some times:

Simply used 

| stats values(*) as * by JobID

 

View solution in original post

Smashley
Explorer

You may want to look at using a transaction to merge the events into a single transaction, though this can be expensive depending on certain factors. Something like adding "| transaction JobID" after the append should do it. Alternately you could do a join rather than append.

0 Karma

lslschr
Engager

just found out the answer after testing some times:

Simply used 

| stats values(*) as * by JobID

 

Get Updates on the Splunk Community!

Splunk APM & RUM | Upcoming Planned Maintenance

There will be planned maintenance of the streaming infrastructure for Splunk APM and Splunk RUM in the coming ...

Part 2: Diving Deeper With AIOps

Getting the Most Out of Event Correlation and Alert Storm Detection in Splunk IT Service Intelligence   Watch ...

User Groups | Upcoming Events!

If by chance you weren't already aware, the Splunk Community is host to numerous User Groups, organized ...