<?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: adding multiple fields and value for fillnull in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400970#M116126</link>
    <description>&lt;P&gt;Thanks Dal &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 23 Jun 2018 02:57:11 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-06-23T02:57:11Z</dc:date>
    <item>
      <title>adding multiple fields and value for fillnull</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400964#M116120</link>
      <description>&lt;P&gt;Following search is working perfectly fine. If &lt;CODE&gt;field1&lt;/CODE&gt; is Null it gets substitute by &lt;CODE&gt;RandomString1&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search
| fillnull value="RandomString1" field1
| stats count by field1, field2, field3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now, if my &lt;CODE&gt;filed2&lt;/CODE&gt; is Null, I want to substitute it by &lt;CODE&gt;RandomString2&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;In short I want to update multiple fileds with different value in &lt;CODE&gt;fillnull&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 22:33:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400964#M116120</guid>
      <dc:creator>ataunk</dc:creator>
      <dc:date>2018-06-21T22:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: adding multiple fields and value for fillnull</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400965#M116121</link>
      <description>&lt;P&gt;@ataunk if you need to replace null values as different values based on different fields, you would need to use separate pipes for fillnull.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourCurrentSearch&amp;gt;
| fillull value="RandomString1" field1
| fillull value="RandomString2" field2
... 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jun 2018 01:41:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400965#M116121</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-06-22T01:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: adding multiple fields and value for fillnull</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400966#M116122</link>
      <description>&lt;P&gt;I tried that, it did not help. I am not getting "RandomString2" in the result set. The particular row is getting elemninated.&lt;/P&gt;

&lt;P&gt;But, "RandomString1" does shows up.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 15:54:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400966#M116122</guid>
      <dc:creator>ataunk</dc:creator>
      <dc:date>2018-06-22T15:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: adding multiple fields and value for fillnull</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400967#M116123</link>
      <description>&lt;P&gt;Try the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourCurrentSearch&amp;gt;
| eval field1=if(isnull(field1),"randomValue1",field1), field2=if(isnull(field2),"randomValue2",field2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If does not work as expected, please give your current search and also some sample events with and without field1 and field2 respectively.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 16:06:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400967#M116123</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-06-22T16:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: adding multiple fields and value for fillnull</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400968#M116124</link>
      <description>&lt;P&gt;This worked thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 17:46:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400968#M116124</guid>
      <dc:creator>ataunk</dc:creator>
      <dc:date>2018-06-22T17:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: adding multiple fields and value for fillnull</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400969#M116125</link>
      <description>&lt;P&gt;@ataunk - We've moved the comment to be an answer.  Please accept the answer so that the question will show as solved. &lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 19:32:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400969#M116125</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-06-22T19:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: adding multiple fields and value for fillnull</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400970#M116126</link>
      <description>&lt;P&gt;Thanks Dal &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jun 2018 02:57:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400970#M116126</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-06-23T02:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: adding multiple fields and value for fillnull</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400971#M116127</link>
      <description>&lt;P&gt;Niket's answer will work perfectly well, but over time I've migrated to using &lt;CODE&gt;coalesce&lt;/CODE&gt;, like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval field1=coalesce(field1,"randomValue1"), field2=coalesce(field2,"randomValue2")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's a little more readable and can also handle multiple fields in the argument section as well.  It's really just a matter of preference.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jun 2018 19:15:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400971#M116127</guid>
      <dc:creator>Kenshiro70</dc:creator>
      <dc:date>2018-06-23T19:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: adding multiple fields and value for fillnull</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400972#M116128</link>
      <description>&lt;P&gt;See this run-anywhere example which works just fine.  The &lt;CODE&gt;never&lt;/CODE&gt; field &lt;EM&gt;never&lt;/EM&gt; exists and the &lt;CODE&gt;name&lt;/CODE&gt; field exists about half the time and the &lt;CODE&gt;sourcetype&lt;/CODE&gt; field exists all the time.  There is no reason that multiple &lt;CODE&gt;fillnull&lt;/CODE&gt; calls should not work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal
| fillnull value="RandomString1" name
| fillnull value="RandomString2" never
| stats count BY name, never, sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jun 2018 20:14:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-multiple-fields-and-value-for-fillnull/m-p/400972#M116128</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-06-30T20:14:56Z</dc:date>
    </item>
  </channel>
</rss>

