<?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: Lookup return same value if not found in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-return-same-value-if-not-found/m-p/140176#M38662</link>
    <description>&lt;P&gt;You can use coalesce()&lt;/P&gt;

&lt;P&gt;From the docs:&lt;BR /&gt;
"This function takes an arbitrary number of arguments and returns the first value that is not null."&lt;/P&gt;

&lt;P&gt;eg: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | lookup users.csv name as name OUTPUT code as code_lookup | eval code=coalesce(code,code_lookup)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This will leave the code field as it was if it existed in the event before, but fill it with the lookup value if it was null.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2013 15:10:43 GMT</pubDate>
    <dc:creator>rmdfrb</dc:creator>
    <dc:date>2013-11-13T15:10:43Z</dc:date>
    <item>
      <title>Lookup return same value if not found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-return-same-value-if-not-found/m-p/140175#M38661</link>
      <description>&lt;P&gt;Hi is there any way to return same value if not found in lookup table? i.e.&lt;BR /&gt;
I have file &lt;/P&gt;

&lt;P&gt;users.csv&lt;/P&gt;

&lt;P&gt;code,name&lt;BR /&gt;
100,jhon&lt;BR /&gt;
200,jane&lt;/P&gt;

&lt;P&gt;and for exmple when i am doing lookup and send for example code 300, i don have it in my table, and it will become NONE, but i want lookup to return 300.&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2013 14:48:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-return-same-value-if-not-found/m-p/140175#M38661</guid>
      <dc:creator>sarumjanuch</dc:creator>
      <dc:date>2013-11-13T14:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup return same value if not found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-return-same-value-if-not-found/m-p/140176#M38662</link>
      <description>&lt;P&gt;You can use coalesce()&lt;/P&gt;

&lt;P&gt;From the docs:&lt;BR /&gt;
"This function takes an arbitrary number of arguments and returns the first value that is not null."&lt;/P&gt;

&lt;P&gt;eg: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | lookup users.csv name as name OUTPUT code as code_lookup | eval code=coalesce(code,code_lookup)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This will leave the code field as it was if it existed in the event before, but fill it with the lookup value if it was null.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2013 15:10:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-return-same-value-if-not-found/m-p/140176#M38662</guid>
      <dc:creator>rmdfrb</dc:creator>
      <dc:date>2013-11-13T15:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup return same value if not found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-return-same-value-if-not-found/m-p/140177#M38663</link>
      <description>&lt;P&gt;I believe its other way around&lt;/P&gt;

&lt;P&gt;| lookup users.csv code as codeFromSearch OUTPUT name as name | eval name=coalesce(name,codeFromSearch)&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2013 16:30:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-return-same-value-if-not-found/m-p/140177#M38663</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-11-13T16:30:43Z</dc:date>
    </item>
  </channel>
</rss>

