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!

Financial Services Industry Use Cases, ITSI Best Practices, and More New Articles ...

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

Splunk Federated Analytics for Amazon Security Lake

Thursday, November 21, 2024  |  11AM PT / 2PM ET Register Now Join our session to see the technical ...

Splunk With AppDynamics - Meet the New IT (And Engineering) Couple

Wednesday, November 20, 2024  |  10AM PT / 1PM ET Register Now Join us in this session to learn all about ...