<?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: Need to get a restult from CSV file by searching in CSV in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609610#M105689</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248596"&gt;@srvnkumr36&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the problem is that after a stats command you have only the fields in the stats, in your case you want to use&amp;nbsp; at the end of your search the field store that isn't present in the previous stats command, you you haven't it.&lt;/P&gt;&lt;P&gt;You have to modify the first stats command adding store.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=***** sourcetype="*****" "Properties.RequestPath"="*/v1/locations*" "Properties.StatusCode"&amp;gt;399 "Properties.TraceId"!="" 
| dedup "Properties.TraceId" 
| rex field=RenderedMessage "/v1/locations/(?&amp;lt;LocationUUID&amp;gt;[^\"]+)" 
| table "Properties.TraceId" LocationUUID "Properties.StatusCode"
| eval IsExist=1 
| append [
   | inputlookup tam_inf_hosts.csv 
   | table LocationUUID 
   | eval IsExist=0
   ] 
| stats max(IsExist) as Exist values(store) AS store by LocationUUID 
| where Exist=0 
| stats values(store) as Stores&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 16 Aug 2022 08:22:17 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-08-16T08:22:17Z</dc:date>
    <item>
      <title>How to get a result from CSV file by searching in CSV?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609593#M105686</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;We have a CSV file with the master data where all the constants are stored and have four columns, in the Splunk query we will get one of the columns as a result.&amp;nbsp; need to change the outcome with another column name from the CSV file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sample - We have an id like this - "58vv1578eff-985sfv294-asfd" from the query result and this need to be changed to -&amp;nbsp; 2897 in the final result.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TIA.,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;SM.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 13:15:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609593#M105686</guid>
      <dc:creator>srvnkumr36</dc:creator>
      <dc:date>2022-08-16T13:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need to get a restult from CSV file by searching in CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609603#M105687</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248596"&gt;@srvnkumr36&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;could you share your search and the structure of your csv file?&lt;/P&gt;&lt;P&gt;Did you indexed it?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 08:03:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609603#M105687</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-08-16T08:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need to get a restult from CSV file by searching in CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609604#M105688</link>
      <description>&lt;P&gt;index=***** sourcetype="*****" "Properties.RequestPath"="*/v1/locations*" "Properties.StatusCode"&amp;gt;399 "Properties.TraceId"!="" | dedup "Properties.TraceId" | rex field=RenderedMessage "/v1/locations/(?&amp;lt;LocationUUID&amp;gt;[^\"]+)" | table "Properties.TraceId" LocationUUID "Properties.StatusCode"| eval IsExist=1 | append [|inputlookup tam_inf_hosts.csv | table LocationUUID | eval IsExist=0] | stats max(IsExist) as Exist by LocationUUID | where Exist=0 | stats values(store) as Stores&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;above is the query. CSV file will have 2 columns - Location UUID and Host.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Location UUID needs to be replaced by the host. No there is no index&amp;nbsp; on CSV file&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 08:06:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609604#M105688</guid>
      <dc:creator>srvnkumr36</dc:creator>
      <dc:date>2022-08-16T08:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need to get a restult from CSV file by searching in CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609610#M105689</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248596"&gt;@srvnkumr36&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the problem is that after a stats command you have only the fields in the stats, in your case you want to use&amp;nbsp; at the end of your search the field store that isn't present in the previous stats command, you you haven't it.&lt;/P&gt;&lt;P&gt;You have to modify the first stats command adding store.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=***** sourcetype="*****" "Properties.RequestPath"="*/v1/locations*" "Properties.StatusCode"&amp;gt;399 "Properties.TraceId"!="" 
| dedup "Properties.TraceId" 
| rex field=RenderedMessage "/v1/locations/(?&amp;lt;LocationUUID&amp;gt;[^\"]+)" 
| table "Properties.TraceId" LocationUUID "Properties.StatusCode"
| eval IsExist=1 
| append [
   | inputlookup tam_inf_hosts.csv 
   | table LocationUUID 
   | eval IsExist=0
   ] 
| stats max(IsExist) as Exist values(store) AS store by LocationUUID 
| where Exist=0 
| stats values(store) as Stores&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 08:22:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609610#M105689</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-08-16T08:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need to get a restult from CSV file by searching in CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609621#M105690</link>
      <description>&lt;P&gt;Still, the location UUID is not replaced by the Store number which is in the CSV file &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 09:45:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609621#M105690</guid>
      <dc:creator>srvnkumr36</dc:creator>
      <dc:date>2022-08-16T09:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need to get a restult from CSV file by searching in CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609655#M105692</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248596"&gt;@srvnkumr36&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;sorry but I don't understand: what's the relation between LocationUUID and store?&lt;/P&gt;&lt;P&gt;to aggregate two data sets (one from the main search and one from the lookup) you need to have the same fieldname.&lt;/P&gt;&lt;P&gt;What are the firlds from the main search and what the ones from the lookup to use?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 14:20:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-a-result-from-CSV-file-by-searching-in-CSV/m-p/609655#M105692</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-08-16T14:20:00Z</dc:date>
    </item>
  </channel>
</rss>

