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!

Dashboard Studio Challenge - Learn New Tricks, Showcase Your Skills, and Win Prizes!

Reimagine what you can do with your dashboards. Dashboard Studio is Splunk’s newest dashboard builder to ...

Introducing Edge Processor: Next Gen Data Transformation

We get it - not only can it take a lot of time, money and resources to get data into Splunk, but it also takes ...

Take the 2021 Splunk Career Survey for $50 in Amazon Cash

Help us learn about how Splunk has impacted your career by taking the 2021 Splunk Career Survey. Last year’s ...