Splunk Search

Join subsearch and realtime

timmalos
Communicator

Got 2 input datas, one pulled every two minutes and the other every 10 minutes.
I would like to have a table containing columns from the two datas (= 2 sourcetypes) in real-time

I used appendcols like this :

sourcetype="cswports" host=sanlacsw2|dedup swFCPortIndex sortby -_time|sort +swFCPortIndex | appendcols [sourcetype="cswports-sfp" host=sanlacsw2 |dedup swSFPId sortby -_time|sort +swFCPortIndex]|table _time swFCPortIndex swFCPortSpecifier swFCPortPhyState swSFPTemp swSFPVoltage swSFPCurrent

But the subsearch is not in real-time.
Do you see another way?
Thxs for your help,

Datas look like : (each line=One port)
Sourcetype=CSWPorts
alt text
Sourcetype=CSWPorts-SFP
alt text

0 Karma
1 Solution

dart
Splunk Employee
Splunk Employee

Does something like this work for your usecase?

sourcetype="cswports" OR sourcetype="cswports-sfp" host=sanlacsw2 | stats first(_time) first(swFCPortSpecifier) first(swFCPortPhyState)  first(swSFPTemp) first(swSFPVoltage) first(swSFPCurrent) by swFCPortIndex

I'm not sure if you want first() or last() in your search

View solution in original post

0 Karma

dart
Splunk Employee
Splunk Employee

Does something like this work for your usecase?

sourcetype="cswports" OR sourcetype="cswports-sfp" host=sanlacsw2 | stats first(_time) first(swFCPortSpecifier) first(swFCPortPhyState)  first(swSFPTemp) first(swSFPVoltage) first(swSFPCurrent) by swFCPortIndex

I'm not sure if you want first() or last() in your search

0 Karma

timmalos
Communicator

was last() but thks !

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...