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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 ...