Dashboards & Visualizations

What eval function returns IP addresses that are not in my input lookup file?

MKAMARA
New Member

I created a dashboard with a lookup file containing IP addresses and domains. I would like to search the dashboard and expect an output of only IP addresses or Domains that are not in my lookup files.

0 Karma

ddrillic
Ultra Champion

Something like -

index=<index name> NOT [ | inputlookup IPs.csv ]

Where the common field such as IP is in the index as well as in the lookup.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

This is no eval function to tell you if some value is not part of a lookup file. In fact, there are no eval functions at all for lookups.

One way to determine that something is not in a lookup is to do the lookup and see if the output is null.

... | lookup mylookup.csv ipaddress OUTPUT domain | eval domainPresent=if(isnull(domain), "false", "true") | ...
---
If this reply helps you, Karma would be appreciated.
0 Karma

MKAMARA
New Member

Rich, Thank you for the response and apologies for the wrong choice of words. I am fetching data from a SharePoint site, within those data, there are sets of IP addresses that I am searching against. All I want to know is what is currently not stored in the sharepoint site. I dont know if this is clear enough. This is my current search that returns data that matches index="my_sharepoint" sourcetype="deadzone_block"
    [| localop
    | stats count
    | eval entry="block_string"
 | eval entry=trim(entry)
    | rex field=entry "(?.*?)(\r|\s|$)" max_match=0
    | mvexpand search
    | table search
    | format ]
| table my_table.

Now how can I change this to return only IPs and domains not match in those set of data?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

What is the point of the localop subsearch? In a distributed environment, it won't find any data since it won't run on indexers. The leading stats command produces a zero that is not used. The eval is a literal string that is then decomposed - why not hardcode the decomposed values?
How are you fetching the data from SharePoint? Can you search for the IP address fetched from SharePoint and discard it if it's already in Splunk?

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...