<?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: data and lookup field problem in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/data-and-lookup-field-problem/m-p/707048#M239195</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/274955"&gt;@secure&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;if you want to filter results from main search using the Event_Codes from the lookup, you must use a subsearch:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=abc 
| rex field=data "\|(?&amp;lt;data&amp;gt;[^\.|]+)?\|(?&amp;lt;Event_Code&amp;gt;[^\|]+)?\|"
| search [ | inputlookup dataeventcode.csv | fields Event_Code ]
| timechart span=1d dc(Event_Code)&lt;/LI-CODE&gt;&lt;P&gt;If you extract the Event_Code field before the search as a field, you can put the subsearch in the main search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2024 15:31:55 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-12-17T15:31:55Z</dc:date>
    <item>
      <title>data and lookup field problem</title>
      <link>https://community.splunk.com/t5/Splunk-Search/data-and-lookup-field-problem/m-p/707046#M239194</link>
      <description>&lt;P class="lia-align-justify"&gt;Hi All&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;i have a csv look up with below data&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&lt;FONT size="3"&gt;Event_Code&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&lt;FONT size="3"&gt;AUB01&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&lt;FONT size="3"&gt;AUB36&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&lt;FONT size="3"&gt;BUA12&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&lt;FONT size="3"&gt;i want to match it with a dataset which has field name&amp;nbsp; Event_Code with several values i need to extract the count of the event code per day from the matching csv lookup&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&lt;FONT size="3"&gt;my query &lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=abc 
|rex field=data "\|(?&amp;lt;data&amp;gt;[^\.|]+)?\|(?&amp;lt;Event_Code&amp;gt;[^\|]+)?\|"
| lookup dataeventcode.csv Event_Code
| timechart span=1d dc(Event_Code)&lt;/LI-CODE&gt;
&lt;P&gt;however the result is showing all 100 count per day instaed of matching the event code from the CSV and then give the total count per day&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 19:44:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/data-and-lookup-field-problem/m-p/707046#M239194</guid>
      <dc:creator>secure</dc:creator>
      <dc:date>2024-12-17T19:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: data and lookup field problem</title>
      <link>https://community.splunk.com/t5/Splunk-Search/data-and-lookup-field-problem/m-p/707048#M239195</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/274955"&gt;@secure&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;if you want to filter results from main search using the Event_Codes from the lookup, you must use a subsearch:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=abc 
| rex field=data "\|(?&amp;lt;data&amp;gt;[^\.|]+)?\|(?&amp;lt;Event_Code&amp;gt;[^\|]+)?\|"
| search [ | inputlookup dataeventcode.csv | fields Event_Code ]
| timechart span=1d dc(Event_Code)&lt;/LI-CODE&gt;&lt;P&gt;If you extract the Event_Code field before the search as a field, you can put the subsearch in the main search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 15:31:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/data-and-lookup-field-problem/m-p/707048#M239195</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-12-17T15:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: data and lookup field problem</title>
      <link>https://community.splunk.com/t5/Splunk-Search/data-and-lookup-field-problem/m-p/707050#M239197</link>
      <description>&lt;P&gt;The query checks the lookup file, but then does nothing with it.&amp;nbsp; That's why all events are counted.&amp;nbsp; Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=abc 
|rex field=data "\|(?&amp;lt;data&amp;gt;[^\.|]+)?\|(?&amp;lt;Event_Code&amp;gt;[^\|]+)?\|"
| lookup dataeventcode.csv Event_Code OUTPUT Event_Code as found
| where isnotnull(found)
| timechart span=1d dc(Event_Code)&lt;/LI-CODE&gt;&lt;P&gt;If the Event_Code field did not need to be extracted via &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; then we could have used &lt;FONT face="courier new,courier"&gt;inputlookup&lt;/FONT&gt; to give Splunk a list of codes to search for.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 15:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/data-and-lookup-field-problem/m-p/707050#M239197</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-12-17T15:36:33Z</dc:date>
    </item>
  </channel>
</rss>

