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!

Splunk Platform | Upgrading your Splunk Deployment to Python 3.9

Splunk initially announced the removal of Python 2 during the release of Splunk Enterprise 8.0.0, aiming to ...

From Product Design to User Insights: Boosting App Developer Identity on Splunkbase

co-authored by Yiyun Zhu & Dan Hosaka Engaging with the Community at .conf24 At .conf24, we revitalized the ...

Detect and Resolve Issues in a Kubernetes Environment

We’ve gone through common problems one can encounter in a Kubernetes environment, their impacts, and the ...