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!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...