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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...