Splunk Search

Using multiple lookups in a search

SN1
Path Finder

hello So i want to make a search .
i am using 

index=endpoint_defender source="AdvancedHunting-DeviceInfo"
| rex field=DeviceName "(?<DeviceName>\w{3}-\w{1,})."
| eval DeviceName=upper(DeviceName)


this gives me devicenames.

now 

| lookup snow_os.csv DeviceName output OS BuildNumber Version


from this lookup i am comparing devicenames and as ouput i am getting OS BuildNumber Version.

SN1_0-1747837933541.png

and from these fields i want to compare them to this lookup to get whether this Operating System is outdated or not.

SN1_1-1747838084737.png
how can i do this ?

 

 





Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Add another lookup command

| lookup OS_Outdated.csv OperatingSystems as OS BuildNumber Version OUTPUT Outdated

 

---
If this reply helps you, Karma would be appreciated.
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The fields names are different between the two lookup tables.  Try the modified command.

---
If this reply helps you, Karma would be appreciated.
0 Karma

SN1
Path Finder

i am doing this but outdated is showing nothing

 

0 Karma

livehybrid
Super Champion

Please can you confirm the field names in your OS lookup?
Thanks

0 Karma

livehybrid
Super Champion

Hi @SN1 

How about 

index=endpoint_defender source="AdvancedHunting-DeviceInfo"
| rex field=DeviceName "(?<DeviceName>\w{3}-\w{1,})."
| eval DeviceName=upper(DeviceName)
| lookup snow_os.csv DeviceName output OS BuildNumber Version
| lookup os_version_status.csv OS BuildNumber Version OUTPUT Outdated
| table DeviceName OS BuildNumber Version Outdated

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma

SN1
Path Finder

index=endpoint_defender source="AdvancedHunting-DeviceInfo"
| rex field=DeviceName "(?<DeviceName>\w{3}-\w{1,})."
| eval DeviceName=upper(DeviceName)
| lookup snow_os.csv DeviceName output OS BuildNumber Version
| lookup OS_Outdated.csv OperatingSystems as OS BuildNumber Version OUTPUT Outdated
| fillnull value=false outdated
| table DeviceName OS BuildNumber Version Outdated

this is i am using but the problem is this line

| lookup OS_Outdated.csv OperatingSystems as OS BuildNumber Version OUTPUT Outdated

is not generating any results

 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

The OS in your first result has OS has "Microsoft Windows 11 Enterprise", whereas your OperatingSystems field in your OS_Outdated.csv lookup does not appear to have "Microsoft" in the name, so naturally it will not match.

You will either have to make your OperatingSystems field a wildcarded lookup or massage your data so the two fields contain similar data.

You also have a small issue with your use of fillnull - you specify a field name "outdated" which is lower case, whereas your field from the lookup is Outdated (capital O)

You can try this search

index=endpoint_defender source="AdvancedHunting-DeviceInfo"
| rex field=DeviceName "(?<DeviceName>\w{3}-\w{1,})."
| eval DeviceName=upper(DeviceName)
| lookup snow_os.csv DeviceName output OS BuildNumber Version
``` Remove the word Microsoft and any following spaces ```
| eval OperatinsSystems=replace(OS, "Microsoft\s*", "")
``` Now use this modified field as the lookup field ```
| lookup OS_Outdated.csv OperatingSystems BuildNumber Version OUTPUT Outdated
| fillnull value=false Outdated
| table DeviceName OS BuildNumber Version Outdated

 

Get Updates on the Splunk Community!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...