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!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...