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!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

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

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...