<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Use each row of a csv as an individual search and return the results in a table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-each-row-of-a-csv-as-an-individual-search-and-return-the/m-p/687553#M234498</link>
    <description>&lt;P&gt;What&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;, but I suspect your problem is that you have&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;client_ip_address earliest latest&lt;/LI-CODE&gt;&lt;P&gt;in your initial search term, which I am guessing corresponds to &lt;STRONG&gt;ip earliest latest&lt;/STRONG&gt; in your lookup. If your data contains a field called ip and that is what you are calling client_ip_address, then remove client_ip_address also from your search.&lt;/P&gt;&lt;P&gt;If your data contains a field called&amp;nbsp;client_ip_address and that is supposed to be a match for the ip in the lookup, then in your subsearch rename ip as client_ip_address.&lt;/P&gt;</description>
    <pubDate>Tue, 14 May 2024 23:55:36 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2024-05-14T23:55:36Z</dc:date>
    <item>
      <title>Use each row of a csv as an individual search and return the results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-each-row-of-a-csv-as-an-individual-search-and-return-the/m-p/687528#M234485</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I've a csv file with 3 columns&lt;STRONG&gt; ip, earliest, latest &lt;/STRONG&gt;and over 400 rows.&amp;nbsp; I'm trying to return all evens associated with the IP for an hour before and after the interesting request time.&amp;nbsp; The search below works for a single row but I can't figure out how treat each row as a unique search and compile the results at the end.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What appears to happen when I upload multiple rows in the csv is the search will run for all interesting IPs from the earliest earliest value to the latest latest value. It kind of meets the intent but is very wasteful as the index is huge and the times span several years with days/months between them.&lt;/P&gt;
&lt;P&gt;Is what I'm trying to achieve possible?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=myindex client_ip_address earliest latest
[| inputlookup ip_list_2.csv
| eval ip = "*" . 'Extracted IP' . "*"
| eval earliest=strptime('REQUEST_TIME', "%m/%d/%y %H:%M")-(60*60)
| eval latest=strptime('REQUEST_TIME', "%m/%d/%y %H:%M")+(60*60)
| fields ip earliest latest
]&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 14 May 2024 22:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-each-row-of-a-csv-as-an-individual-search-and-return-the/m-p/687528#M234485</guid>
      <dc:creator>tnegun</dc:creator>
      <dc:date>2024-05-14T22:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Use each row of a csv as an individual search and return the results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-each-row-of-a-csv-as-an-individual-search-and-return-the/m-p/687548#M234496</link>
      <description>&lt;P&gt;I am not sure what the problem is if it works! Having said that, I am not sure what the earliest and latest are doing on the index line. Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex client_ip_address
[| inputlookup ip_list_2.csv
| eval ip = "*" . 'Extracted IP' . "*"
| eval earliest=strptime('REQUEST_TIME', "%m/%d/%y %H:%M")-(60*60)
| eval latest=strptime('REQUEST_TIME', "%m/%d/%y %H:%M")+(60*60)
| fields ip earliest latest
]&lt;/LI-CODE&gt;&lt;P&gt;The subsearch becomes a series of (ip=value AND earliest=value AND latest=value) joined by ORs which is what you appear to want. Or am I missing something?&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 22:56:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-each-row-of-a-csv-as-an-individual-search-and-return-the/m-p/687548#M234496</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-05-14T22:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Use each row of a csv as an individual search and return the results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-each-row-of-a-csv-as-an-individual-search-and-return-the/m-p/687553#M234498</link>
      <description>&lt;P&gt;What&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;, but I suspect your problem is that you have&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;client_ip_address earliest latest&lt;/LI-CODE&gt;&lt;P&gt;in your initial search term, which I am guessing corresponds to &lt;STRONG&gt;ip earliest latest&lt;/STRONG&gt; in your lookup. If your data contains a field called ip and that is what you are calling client_ip_address, then remove client_ip_address also from your search.&lt;/P&gt;&lt;P&gt;If your data contains a field called&amp;nbsp;client_ip_address and that is supposed to be a match for the ip in the lookup, then in your subsearch rename ip as client_ip_address.&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 23:55:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-each-row-of-a-csv-as-an-individual-search-and-return-the/m-p/687553#M234498</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-05-14T23:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Use each row of a csv as an individual search and return the results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-each-row-of-a-csv-as-an-individual-search-and-return-the/m-p/687604#M234515</link>
      <description>&lt;P&gt;Apologies there was a typo as I renamed fields to try generalize this is the search I'm trying&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex ip earliest latest
[| inputlookup ip_list_2.csv
| eval ip = "*" . 'Extracted IP' . "*"
| eval earliest=strptime('REQUEST_TIME', "%m/%d/%y %H:%M")-(60*60)
| eval latest=strptime('REQUEST_TIME', "%m/%d/%y %H:%M")+(60*60)
| fields ip earliest latest
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an sample of the csv&lt;/P&gt;&lt;TABLE width="242"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;REQUEST_TIME&lt;/TD&gt;&lt;TD&gt;Extracted IP&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="121"&gt;3/29/24 16:13&lt;/TD&gt;&lt;TD width="121"&gt;1.1.1.1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3/14/24 8:51&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2.2.2.2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/26/24 13:24&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3.3.3.3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had though the search was running like this and stopped it&lt;/P&gt;&lt;P&gt;index=myindex (ip=1.1.1.1 OR ip =2.2.2.2 OR ip=3.3.3.3) earliest=1/26/24 13:24 latest =3/29/24 16:13 .&lt;/P&gt;&lt;P&gt;I only want to report on IP 1.1.1.1's activity at 3/29/24 16:13 and not any other time.&lt;/P&gt;&lt;P&gt;Thanks I'll try the suggestions and report back.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 10:37:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-each-row-of-a-csv-as-an-individual-search-and-return-the/m-p/687604#M234515</guid>
      <dc:creator>tnegun</dc:creator>
      <dc:date>2024-05-15T10:37:24Z</dc:date>
    </item>
  </channel>
</rss>

