<?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 automatic lookup based on condition in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/automatic-lookup-based-on-condition/m-p/516874#M145299</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;My CSV(&lt;SPAN class="s1"&gt;test_csv_lookup)&lt;/SPAN&gt; looks like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;index; value&lt;/P&gt;&lt;P&gt;1, 1.1.1.1&lt;/P&gt;&lt;P&gt;---- here is my automatic lookup&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;LOOKUP-field_extract = test_csv_lookup index AS ip OUTPUTNEW value AS lookedup_val&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two following events in the index for which I will apply the the above automatic lookup:&amp;nbsp;&lt;/P&gt;&lt;P&gt;event1 -&amp;nbsp; timestmap, 1&lt;/P&gt;&lt;P&gt;event2 - timestmap, 2.2.2.2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In above event, the "ip" field values are "1", and "2.2.2.2", in the first event, "1" being the value of the "ip" ,&amp;nbsp; just refers to the index value of the lookup table and second event just contain raw value, and doesn't need lookup.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I query for the index, the lookedup_val&amp;nbsp; shows the "1.1.1.1". What I need is that, both the values(in the field&lt;SPAN class="s1"&gt;lookedup_val)&amp;nbsp;&lt;/SPAN&gt;, that is "1.1.1.1" and "2.2.2.2".&amp;nbsp; For the first event, its working fine, by looking up the index and able to retrieve, for the second event also it's doing the lookup and obviously it can't find.&amp;nbsp; When lookup can't find the value, could it' use the raw value or default field value, in this case, 2.2.2.2? Is there a way I can specify this in automatic lookup output?&lt;/P&gt;&lt;P class="p1"&gt;Thanks,&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 29 Aug 2020 17:49:11 GMT</pubDate>
    <dc:creator>mahe90</dc:creator>
    <dc:date>2020-08-29T17:49:11Z</dc:date>
    <item>
      <title>automatic lookup based on condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/automatic-lookup-based-on-condition/m-p/516874#M145299</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;My CSV(&lt;SPAN class="s1"&gt;test_csv_lookup)&lt;/SPAN&gt; looks like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;index; value&lt;/P&gt;&lt;P&gt;1, 1.1.1.1&lt;/P&gt;&lt;P&gt;---- here is my automatic lookup&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;LOOKUP-field_extract = test_csv_lookup index AS ip OUTPUTNEW value AS lookedup_val&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two following events in the index for which I will apply the the above automatic lookup:&amp;nbsp;&lt;/P&gt;&lt;P&gt;event1 -&amp;nbsp; timestmap, 1&lt;/P&gt;&lt;P&gt;event2 - timestmap, 2.2.2.2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In above event, the "ip" field values are "1", and "2.2.2.2", in the first event, "1" being the value of the "ip" ,&amp;nbsp; just refers to the index value of the lookup table and second event just contain raw value, and doesn't need lookup.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I query for the index, the lookedup_val&amp;nbsp; shows the "1.1.1.1". What I need is that, both the values(in the field&lt;SPAN class="s1"&gt;lookedup_val)&amp;nbsp;&lt;/SPAN&gt;, that is "1.1.1.1" and "2.2.2.2".&amp;nbsp; For the first event, its working fine, by looking up the index and able to retrieve, for the second event also it's doing the lookup and obviously it can't find.&amp;nbsp; When lookup can't find the value, could it' use the raw value or default field value, in this case, 2.2.2.2? Is there a way I can specify this in automatic lookup output?&lt;/P&gt;&lt;P class="p1"&gt;Thanks,&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2020 17:49:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/automatic-lookup-based-on-condition/m-p/516874#M145299</guid>
      <dc:creator>mahe90</dc:creator>
      <dc:date>2020-08-29T17:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: automatic lookup based on condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/automatic-lookup-based-on-condition/m-p/516895#M145306</link>
      <description>&lt;P&gt;you can't do that. but you can write below in your search.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval lookedup_val = if(isnull(lookedup_val),ip,lookedup_val)&lt;/LI-CODE&gt;&lt;P&gt;if you think, you can add this to props.conf, it won't work because first EVAL will be executed then&amp;nbsp;Lookup configuration will be executed next.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Knowledge/Searchtimeoperationssequence" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.5/Knowledge/Searchtimeoperationssequence&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 07:32:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/automatic-lookup-based-on-condition/m-p/516895#M145306</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-30T07:32:59Z</dc:date>
    </item>
  </channel>
</rss>

