Splunk Search

Add an inputlookup from a csv to an existing search

Hudond
Path Finder

Good Morning

As I am new to Splunk,  sometimes I need to try things that are beyond my comprehension at this time. 

This is one of those cases:

I have the following search that lists the hosts with system information:

index="index1" OR index="index2" sourcetype=WinHostMon (source=operatingsystem os="*" TotalPhysicalMemoryKB="*") OR (source=processor NumberOfProcessors="*") OR (source=disk DriveType=fixed TotalSpaceKB)
| eval RAM = round (((TotalPhysicalMemoryKB)/1000000),1)
| eval DiskSpace = round (((TotalSpaceKB)/1000000),1)
| stats values(os) as OS, values(NumberOfProcessors) as CPU, values(RAM) as "RAM (GB)", values(DiskSpace) as TotalDiskSpace by host
| eventstats sum(TotalDiskSpace) as "LogicalDiskSpace (GB)" by host
| table host, OS, CPU, "RAM (GB)", "LogicalDiskSpace (GB)"

====================================================

I need to add an inputlookup command to display other fields associated to each host that is displayed in the search above.

I have setup the input lookup table and the definition and I am able to run the lookup and extract the fields i need.

| inputlookup otherinfo.csv

host   field1    field2    field3

The difficult part that I have been struggling with is trying to add that step into the search above.

Any guidance or information that can be provided to help me learn would be appreciated.

Thank you

Labels (1)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @Hudond,

Just adding lookup command will add all fields to output;

| lookup otherinfo.csv host 

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

scelikok
SplunkTrust
SplunkTrust

Hi @Hudond,

Just adding lookup command will add all fields to output;

| lookup otherinfo.csv host 

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.

Hudond
Path Finder

Thank you for the information that worked

so in this case it was best to use lookup not inputlookup, need to review the difference use case scenarios

0 Karma
Get Updates on the Splunk Community!

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...

Industry Solutions for Supply Chain and OT, Amazon Use Cases, Plus More New Articles ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Enterprise Security Content Update (ESCU) | New Releases

In November, the Splunk Threat Research Team had one release of new security content via the Enterprise ...