Splunk Search

How to search a list of IPs between specific time ranges from a lookup CSV file?

rusty009
Path Finder

I am looking to search for a given value (an IP in this case) between a specific time range. This is easy to do as a one off, but I have a large number of IP’s I need to search for and would ideally like to have a lookup table, with the IP’s and date ranges and for it to be searched for automatically like the below search.csv lookup,

‘src’,’earliest’,’latest’
‘1.1.1.1’, 11/27/2015:10:00:00, 11/27/2015:11:00:00

but it doesn’t seem to be working. Am I doing something wrong? Is there a batter way to do this?

Thanks!

0 Karma
1 Solution

jkat54
SplunkTrust
SplunkTrust

I would drop the latest, and move the earliest field to the first column and rename it to datetime... etc.

Then in props.conf I'd use TIMESTAMP_FIELDS = datetime

http://docs.splunk.com/Documentation/Splunk/6.2.6/Admin/Propsconf

Then I'd index the csv instead of using it as a lookup.

Then you can do things like searching for a specific time frame... and you'll only see events from that time frame with the Ips from that time frame.

You can then do things like | stats min(datetime) by IP .... | timechart max(datetime) by IP ....

View solution in original post

0 Karma

jkat54
SplunkTrust
SplunkTrust

I would drop the latest, and move the earliest field to the first column and rename it to datetime... etc.

Then in props.conf I'd use TIMESTAMP_FIELDS = datetime

http://docs.splunk.com/Documentation/Splunk/6.2.6/Admin/Propsconf

Then I'd index the csv instead of using it as a lookup.

Then you can do things like searching for a specific time frame... and you'll only see events from that time frame with the Ips from that time frame.

You can then do things like | stats min(datetime) by IP .... | timechart max(datetime) by IP ....

0 Karma

jkat54
SplunkTrust
SplunkTrust

Any relation to this question? https://answers.splunk.com/answers/334605/inputlookup-on-csv-including-date-ranges-in-csv-he.html

Is this a duplicate question written by a different member of your team?

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...