Splunk Search

How do I merge these search results into one line?

leochan
Explorer

Is there a way to combine the following the following result into one line?

Current Result:

q2.example.com  26,575.24    
q2.example.com                  595.89 MB
1p.example.com  12,911.08    
1p.example.com              218.39 MB

Expected Result:

q2.example.com  26,575.24    595.89 MB
1p.example.com     12,911.08    218.39 MB

Sample data:

11/13/2015 21:04:42 Total number of bytes transferred:       44,745.47 KB/sec
11/14/2015 21:20:57 Total number of bytes transferred:       42,745.47 KB/sec
11/13/2015 21:04:42 Aggregate data transfer rate:       242.22 MB
11/14/2015 21:20:57 Aggregate data transfer rate:       145.39 MB

Links I visited and tried:
https://answers.splunk.com/answers/58845/multiple-searches-in-one-chart.html
https://answers.splunk.com/answers/40165/merge-two-search-results.html

Search:

index=os_linux earliest=-1d ("Aggregate data transfer rate" OR "Total number of bytes transferred") | rex field=_raw "Aggregate data transfer rate: (?<AggregateTransfer>.*)KB\/sec" | rex field=_raw "Total number of bytes transferred: (?<TotalTransfer>.*)" | table host, AggregateTransfer,TotalTransfer
Tags (3)
0 Karma
1 Solution

jluo_splunk
Splunk Employee
Splunk Employee

You could do a transaction, though the performance isn't great.

... | transaction host

View solution in original post

0 Karma

sundareshr
Legend

Try this

index=os_linux earliest=-1d "Aggregate"  OR "Total"| rex "e:\s+(?<AggregateTransfer>[\d,\.]+)"  | rex "d:\s+(?<TotalTransfer>[\d,\.]+)"| timechart span=1d sum(AggregateTransfer) as Agg sum(TotalTransfer) as Total | fields - _time
0 Karma

leochan
Explorer

sundareshr,

I don't mean to do a sum, just put all the same fields in one line (See current and expected result).

I think jluo got it.

0 Karma

jluo_splunk
Splunk Employee
Splunk Employee

You could do a transaction, though the performance isn't great.

... | transaction host

0 Karma

leochan
Explorer

Thanks Jluo!

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...