<?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: Help with replacing values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280430#M84636</link>
    <description>&lt;P&gt;Yeah, but he is matching a literal string &lt;CODE&gt;null&lt;/CODE&gt; - the values aren't actually null, they're filled with a literal value, which just happens to be the string, &lt;CODE&gt;null&lt;/CODE&gt;. So the &lt;CODE&gt;fillnull&lt;/CODE&gt; command sadly won't work here.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Oct 2015 23:46:57 GMT</pubDate>
    <dc:creator>aljohnson_splun</dc:creator>
    <dc:date>2015-10-14T23:46:57Z</dc:date>
    <item>
      <title>Help with replacing values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280428#M84634</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have my output I was looking for, but was wondering if there was a cleaner way to do it.  Basically I have a field like such f1||f2||f3||f4.  f2 and f3 can be null in some cases.  If they are null I wanted to replace them with my own string.  right now i have this as my query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=transaction_type "(?&amp;lt;TransferType&amp;gt;.)||(?&amp;lt;FromAcct&amp;gt;.)||(?&amp;lt;ToAcct&amp;gt;.)||(?&amp;lt;When&amp;gt;.)"
| eval FromAcct = if(FromAcct="null", "Non" ,FromAcct)
| eval ToAcct = if(ToAcct="null", "Non" ,ToAcct)
| stats count by TransferType, FromAcct, ToAcct, When
| sort count desc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I dont like that i have two evals cases where I use if.  I wanted to use eval case but wasn't able to get it to work because of how I parse my field.  &lt;/P&gt;

&lt;P&gt;Thanks for the help!&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 23:40:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280428#M84634</guid>
      <dc:creator>jameskerivan</dc:creator>
      <dc:date>2015-10-14T23:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help with replacing values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280429#M84635</link>
      <description>&lt;P&gt;Hi jameskerivan,&lt;/P&gt;

&lt;P&gt;Have you seen the fillnull command.  it can replace nulls with a value.  Refer to: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/Fillnull"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/Fillnull&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 23:45:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280429#M84635</guid>
      <dc:creator>gcato</dc:creator>
      <dc:date>2015-10-14T23:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help with replacing values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280430#M84636</link>
      <description>&lt;P&gt;Yeah, but he is matching a literal string &lt;CODE&gt;null&lt;/CODE&gt; - the values aren't actually null, they're filled with a literal value, which just happens to be the string, &lt;CODE&gt;null&lt;/CODE&gt;. So the &lt;CODE&gt;fillnull&lt;/CODE&gt; command sadly won't work here.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 23:46:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280430#M84636</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2015-10-14T23:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help with replacing values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280431#M84637</link>
      <description>&lt;P&gt;Yes, very true.  I'd suggest the rex command then.&lt;BR /&gt;
    ...| rex mode=sed field=_raw "s/null/Non/g" |rex field=transaction_type ...&lt;BR /&gt;
Note: Must happen before the rex field extraction&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:37:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280431#M84637</guid>
      <dc:creator>gcato</dc:creator>
      <dc:date>2020-09-29T07:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with replacing values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280432#M84638</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=transaction_type "(?&amp;lt;TransferType&amp;gt;.)||(?&amp;lt;FromAcct&amp;gt;.)||(?&amp;lt;ToAcct&amp;gt;.)||(?&amp;lt;When&amp;gt;.)"
| replace "null" WITH "Non" IN ToAcct FromAcct
| stats count by TransferType, FromAcct, ToAcct, When
| sort count desc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Oct 2015 00:08:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280432#M84638</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-15T00:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help with replacing values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280433#M84639</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 17:36:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-replacing-values/m-p/280433#M84639</guid>
      <dc:creator>jameskerivan</dc:creator>
      <dc:date>2015-10-15T17:36:55Z</dc:date>
    </item>
  </channel>
</rss>

