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!

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

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

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...