<?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 CSV Lookup for search query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/CSV-Lookup-for-search-query/m-p/516621#M145208</link>
    <description>&lt;P&gt;I prepared csv to inputlookup to compare the Splunk logs.&lt;/P&gt;&lt;P&gt;adhoc.csv&lt;/P&gt;&lt;P&gt;//&lt;/P&gt;&lt;P&gt;Account,&lt;/P&gt;&lt;P&gt;test01,etc....&lt;/P&gt;&lt;P&gt;test02,etc....&lt;/P&gt;&lt;P&gt;//&lt;/P&gt;&lt;P&gt;my Query&lt;/P&gt;&lt;P&gt;index=msad sourcetype=msad&amp;nbsp;[| inputlookup adhoc.csv | fields Account]&amp;nbsp;&lt;BR /&gt;Searching Period: Last 24 hours&lt;/P&gt;&lt;P&gt;Cross check adhoc.csv match the searching logs.&lt;/P&gt;&lt;P&gt;For those account did not perform any authentation which logs stored at index=msad, during search period, then show zero values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Aug 2020 02:45:02 GMT</pubDate>
    <dc:creator>keyu921</dc:creator>
    <dc:date>2020-08-28T02:45:02Z</dc:date>
    <item>
      <title>CSV Lookup for search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/CSV-Lookup-for-search-query/m-p/516621#M145208</link>
      <description>&lt;P&gt;I prepared csv to inputlookup to compare the Splunk logs.&lt;/P&gt;&lt;P&gt;adhoc.csv&lt;/P&gt;&lt;P&gt;//&lt;/P&gt;&lt;P&gt;Account,&lt;/P&gt;&lt;P&gt;test01,etc....&lt;/P&gt;&lt;P&gt;test02,etc....&lt;/P&gt;&lt;P&gt;//&lt;/P&gt;&lt;P&gt;my Query&lt;/P&gt;&lt;P&gt;index=msad sourcetype=msad&amp;nbsp;[| inputlookup adhoc.csv | fields Account]&amp;nbsp;&lt;BR /&gt;Searching Period: Last 24 hours&lt;/P&gt;&lt;P&gt;Cross check adhoc.csv match the searching logs.&lt;/P&gt;&lt;P&gt;For those account did not perform any authentation which logs stored at index=msad, during search period, then show zero values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 02:45:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/CSV-Lookup-for-search-query/m-p/516621#M145208</guid>
      <dc:creator>keyu921</dc:creator>
      <dc:date>2020-08-28T02:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: CSV Lookup for search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/CSV-Lookup-for-search-query/m-p/516625#M145209</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/67502"&gt;@keyu921&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's not overly clear what you are asking for so I not going to try, however if you want to have an OR statement generated for you base search, from the adhoc.csv file, then you need to use the &lt;STRONG&gt;format&lt;/STRONG&gt; command, as shown&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... your search ... [| inputlookup adhoc.csv | fields Account | format] | ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Substituted result of the subsearch would be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; ... your search ... ( ( Account="test1" ) OR ( Account="test2" ) ) | ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Having said that, more often than not, the use of the &lt;STRONG&gt;lookup&lt;/STRONG&gt; command is far more efficient ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... your search ...
| lookup adhoc.csv Account AS Account OUTPUTNEW &amp;lt;...some new field in adhoc.csv...&amp;gt;
| where isnotnull(&amp;lt;some new field&amp;gt;) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check the Splunk docs for more details, if interested.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 03:32:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/CSV-Lookup-for-search-query/m-p/516625#M145209</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2020-08-28T03:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: CSV Lookup for search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/CSV-Lookup-for-search-query/m-p/516627#M145211</link>
      <description>&lt;P&gt;This will show you all the Account names from the CSV that did NOT have any entries in the msad log in the time period given. It first searches and counts all the data for the monitored accounts, then adds back all the accounts being monitored and just then looks for ones with no count value.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=msad sourcetype=msad [| inputlookup adhoc.csv | fields Account] 
| stats count by Account
| append [
  | inputlookup adhoc.csv | fields Account
]
| stats values(count) as count by Account 
| where isnull(count)&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 03:51:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/CSV-Lookup-for-search-query/m-p/516627#M145211</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-08-28T03:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: CSV Lookup for search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/CSV-Lookup-for-search-query/m-p/516643#M145218</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/67502"&gt;@keyu921&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=msad sourcetype=msad 
| eval Account=lower(Account)
| stats count BY Account
| append [| inputlookup adhoc.csv | eval Account=lower(Account), count=0 | fields Account count] 
| stats sum(count) AS total BY Account
| where total=0&lt;/LI-CODE&gt;&lt;P&gt;In this way,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;total&amp;gt;o means that there are logs,&lt;/LI&gt;&lt;LI&gt;total=0 means that there aren't logs.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;As you requested, I added at the end a filter to display only the ones without logs, but you could also create a dashboard displaying all the Accounts with their status.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 06:55:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/CSV-Lookup-for-search-query/m-p/516643#M145218</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-08-28T06:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: CSV Lookup for search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/CSV-Lookup-for-search-query/m-p/520418#M146534</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/67502"&gt;@keyu921&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Sep 2020 10:20:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/CSV-Lookup-for-search-query/m-p/520418#M146534</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-19T10:20:13Z</dc:date>
    </item>
  </channel>
</rss>

