Splunk Search

Help with lookup

hank72
Path Finder

Hi. Please I need some help.

Different devices, all with different port numbers. How to create a single search that will use lookup table to check multiple devices and different portid with notes?

device,portid,notes
device1,2,cube1
device1,4,cube7
device1,6,cube8
device2,5,cube3
device2,6,cube2
device3,1,cube6
device3,5,cube9
device3,7,cube4

This is a search for one device (device1) and it's ports. But now I have many more devices all with different ports.
index=myindex device=device1 type=port speed=1Gfdx state=down | where in(portid,2,4,6) | table device, portid, state

Thank you.
Hank

0 Karma

richgalloway
SplunkTrust
SplunkTrust

A subsearch should do it. The format command converts the fields into ((device=1 port=2) OR (device=1 port=4)...).

index=myindex speed=1Gfdx state=down
   [ | inputlookup mylookup | fields device,portid | format ]
| table device, portid, state
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...