Getting Data In

Why is my inputlookup search not returning all results from the CSV file?

jbradley76
Engager

Hello All,

I have a CSV file with a single column, address, with about 1000 IP addresses below. I am attempting to search our proxy logs for any of the IP addresses that have accessed the internet and display the IP address with the TLD's that they have visited.

If I do a simple |inputlookup iplisttest.csv I receive the output of the CSV that lists all the IP's perfectly.

address
1.1.1.1
2.2.2.2
3.3.3.3
4.4.4.4

If I do a full search of sourcetype="proxy" [|inputlookup iplisttest.csv | return $address] | stats values(dest) by src I get the first result only which is actually the second IP address in the list.

src                values(dest)
2.2.2.2             website2.com

Been beating my head against the wall on this one, so any help out be greatly appreciated!

Tags (2)
0 Karma
1 Solution

jbradley76
Engager
index=idx_proxy sourcetype="proxy" 
| fields dest, src 
| lookup iplisttest.csv address as src OUTPUT address as src_ip | search src_ip=* | stats values(dest) by src

This is what solved the problem, found by one of our engineers. Seems the lookup command did the trick!

Thanks All!

View solution in original post

0 Karma

jbradley76
Engager
index=idx_proxy sourcetype="proxy" 
| fields dest, src 
| lookup iplisttest.csv address as src OUTPUT address as src_ip | search src_ip=* | stats values(dest) by src

This is what solved the problem, found by one of our engineers. Seems the lookup command did the trick!

Thanks All!

0 Karma

somesoni2
Revered Legend

Try something like this (assuming you want to do a text search on the IP addresses from the lookup)

sourcetype="proxy" [|inputlookup iplisttest.csv | eval search=address | table search] | stats values(dest) by src
0 Karma

Lowell
Super Champion

Subsearches will only return up to 10,000 results by default. Check out limits.conf docs for more details.

You may want to consider rewriting the search to avoid using a subsearch by using the lookup command directly.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...