<?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: Alert if csv entry exists but not returned in search when comparing values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-alert-if-csv-entry-exists-but-not-returned-in-search-when/m-p/623689#M216813</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/42672"&gt;@greekleo89&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand, you have:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;a lookup from a csv file,&lt;/LI&gt;&lt;LI&gt;containing many fiels, one of them is "company"&lt;/LI&gt;&lt;LI&gt;in the lookup there are some values that aren't present in the main search,&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;is it correct?&lt;/P&gt;&lt;P&gt;I didn't understand if this lookup is tha same already used in the search or another one, but it isn't relevant, please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main sourcetype="my_stats" type="add-ons"
| spath config{}
| mvexpand config{}
| spath input=config{}
| lookup add-ons.csv "Configuration Item" as displayName OUTPUTNEW "Configuration Setting" as "default"
| stats list(type) as type list(displayName) as item list(name) as value list(default) as default list(owner) as owner count BY company
| append [ 
   | inputlookup  add-ons.csv 
   | rename 
      "Configuration Item" AS displayName 
      "Configuration Setting" AS "default"
   | eval count=0
   | fields displayName default count
   ]
| stats 
   list(type) AS type
   list(displayName) AS item
   list(name) AS value
   list(default) AS default
   list(owner) AS owner
   sum(count) AS total 
   BY company
| eval status=if(total=0,"Not present","Present")
| fields - total&lt;/LI-CODE&gt;&lt;P&gt;if you want to display only non matching events, you add at the end "| where total=0".&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2022 10:26:11 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-12-08T10:26:11Z</dc:date>
    <item>
      <title>How to alert if csv entry exists but not returned in search when comparing values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-alert-if-csv-entry-exists-but-not-returned-in-search-when/m-p/623688#M216812</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am comparing the values from a csv with those returned in a json format on a splunk search.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At the moment the search works as i want it.&amp;nbsp; But i noticed that in some instances the results from the splunk search do not bring back all the entries because simply for that customer they do not exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the csv i have all the entries that should exist and match, and if one doesnt match then return it as a result, but where i am struggling is getting the search to also output and say, hold on, this entry with this value is in the csv but its not in the search.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The entries which are not returned in the search are important to us because it means something isn't turned on so we need to go to that customer and rectify it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The search atm looks like this&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;index=main sourcetype="my_stats" type="add-ons"&lt;BR /&gt;| spath config{}&lt;BR /&gt;| mvexpand config{}&lt;BR /&gt;| spath input=config{}&lt;BR /&gt;| lookup add-ons.csv "Configuration Item" as displayName OUTPUTNEW "Configuration Setting" as "default"&lt;BR /&gt;|stats list(type) as type list(displayName) as item list(name) as value list(default) as default list(owner) as owner by company&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Greg&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 19:49:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-alert-if-csv-entry-exists-but-not-returned-in-search-when/m-p/623688#M216812</guid>
      <dc:creator>greekleo89</dc:creator>
      <dc:date>2022-12-09T19:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if csv entry exists but not returned in search when comparing values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-alert-if-csv-entry-exists-but-not-returned-in-search-when/m-p/623689#M216813</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/42672"&gt;@greekleo89&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand, you have:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;a lookup from a csv file,&lt;/LI&gt;&lt;LI&gt;containing many fiels, one of them is "company"&lt;/LI&gt;&lt;LI&gt;in the lookup there are some values that aren't present in the main search,&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;is it correct?&lt;/P&gt;&lt;P&gt;I didn't understand if this lookup is tha same already used in the search or another one, but it isn't relevant, please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main sourcetype="my_stats" type="add-ons"
| spath config{}
| mvexpand config{}
| spath input=config{}
| lookup add-ons.csv "Configuration Item" as displayName OUTPUTNEW "Configuration Setting" as "default"
| stats list(type) as type list(displayName) as item list(name) as value list(default) as default list(owner) as owner count BY company
| append [ 
   | inputlookup  add-ons.csv 
   | rename 
      "Configuration Item" AS displayName 
      "Configuration Setting" AS "default"
   | eval count=0
   | fields displayName default count
   ]
| stats 
   list(type) AS type
   list(displayName) AS item
   list(name) AS value
   list(default) AS default
   list(owner) AS owner
   sum(count) AS total 
   BY company
| eval status=if(total=0,"Not present","Present")
| fields - total&lt;/LI-CODE&gt;&lt;P&gt;if you want to display only non matching events, you add at the end "| where total=0".&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 10:26:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-alert-if-csv-entry-exists-but-not-returned-in-search-when/m-p/623689#M216813</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-12-08T10:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if csv entry exists but not returned in search when comparing values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-alert-if-csv-entry-exists-but-not-returned-in-search-when/m-p/623701#M216816</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Sorry perhaps i was not being very clear - i ommited some search strings on there so apologies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The csv is like this&lt;BR /&gt;&lt;BR /&gt;Configuration Item, Configuration Setting&lt;BR /&gt;Boss, On&lt;BR /&gt;Rogue,Off&lt;BR /&gt;Report,Off&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The results come back like this in the search:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;config&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://splunk.redscan.com:8000/en-GB/app/rs_engineering/search?q=search%20index%3Drs-s1%20sourcetype%3D%22rs-s1_stats%22%20type%3D%22add-ons%22&amp;amp;display.page.search.mode=smart&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-15m&amp;amp;latest=now&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=events&amp;amp;sid=1670497769.6183443#" target="_blank" rel="noopener"&gt;[-]&lt;/A&gt;&lt;SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&lt;A class="" href="https://splunk.redscan.com:8000/en-GB/app/rs_engineering/search?q=search%20index%3Drs-s1%20sourcetype%3D%22rs-s1_stats%22%20type%3D%22add-ons%22&amp;amp;display.page.search.mode=smart&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-15m&amp;amp;latest=now&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=events&amp;amp;sid=1670497769.6183443#" target="_blank" rel="noopener"&gt;[-]&lt;/A&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;displayName&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class=""&gt;Remote Script Orchestration&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;name&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class=""&gt;rso&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;.....&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;comapanyid:xxxx&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The company ID i get to match by doing a dbxquery, please see the full search below&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;index=main sourcetype="_stats" type="add-ons"&lt;BR /&gt;| spath config{}&lt;BR /&gt;| mvexpand config{}&lt;BR /&gt;| spath input=config{}&lt;BR /&gt;| lookup add-ons.csv "Configuration Item" as displayName OUTPUTNEW "Configuration Setting" as "default"&lt;BR /&gt;|rename cust as company&lt;BR /&gt;|rename customerName as Customer&lt;BR /&gt;| join company&lt;BR /&gt;[| dbxquery query="SELECT * FROM systems WHERE status IN ('1') AND (sT=28) AND owner IN ('1','2')" connection="conn" ]&lt;BR /&gt;|stats list(type) as type list(displayName) as item list(name) as value list(default) as default list(owner) as owner by company&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So if there is a mismatch form the results in the search to the csv then i would receive a result of the variables in the stats.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i also need to do is:&lt;BR /&gt;&lt;BR /&gt;lets say that in the search results&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there is no entry for&amp;nbsp;Report,Off but this exists in the csv, i'd want to know about it so that i can go to that particular customer and turn it on, only then it will be visibile in the data we receive back from them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Greg&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 11:19:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-alert-if-csv-entry-exists-but-not-returned-in-search-when/m-p/623701#M216816</guid>
      <dc:creator>greekleo89</dc:creator>
      <dc:date>2022-12-08T11:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if csv entry exists but not returned in search when comparing values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-alert-if-csv-entry-exists-but-not-returned-in-search-when/m-p/623818#M216876</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp; any updates?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 08:45:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-alert-if-csv-entry-exists-but-not-returned-in-search-when/m-p/623818#M216876</guid>
      <dc:creator>greekleo89</dc:creator>
      <dc:date>2022-12-09T08:45:54Z</dc:date>
    </item>
  </channel>
</rss>

