<?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: replace found data with &amp;quot;fix&amp;quot; and no data with &amp;quot;NULL&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85496#M21844</link>
    <description>&lt;P&gt;Yes for the fillnull value.&lt;/P&gt;

&lt;P&gt;I've tried to just use &lt;BR /&gt;
replace [*] with [fix], but now it's giving me a search error.&lt;/P&gt;

&lt;P&gt;I'm very new to Splunk, but here's the (latest version of the) part of the query I'm trying to run.&lt;/P&gt;

&lt;P&gt;| fillnull value=NULL cs5 | replace [*] with [fix] cs5 |&lt;/P&gt;

&lt;P&gt;I know that's probably the reason that all I was getting were "fix" results because the wildcard is catching everything.  I'm not sure how to tell Splunk to differentiate between found data and NULL.  And I need a null value so that I can get Splunk to count the instances of null.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Oct 2013 15:38:19 GMT</pubDate>
    <dc:creator>CharterBT</dc:creator>
    <dc:date>2013-10-07T15:38:19Z</dc:date>
    <item>
      <title>replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85493#M21841</link>
      <description>&lt;P&gt;I'm trying to perform a search where if there is data found in a specific field , then I want the report to replace that data with the word "fix".  Conversely, if the field is empty, then I want the word "NULL" to display in my results.  &lt;/P&gt;

&lt;P&gt;Every time I try it, it seems my NULL values are getting overwritten and all I'm getting are "fix" in the cs5 field.  &lt;/P&gt;

&lt;P&gt;Any help is appreciated.  Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 15:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85493#M21841</guid>
      <dc:creator>CharterBT</dc:creator>
      <dc:date>2013-10-07T15:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85494#M21842</link>
      <description>&lt;P&gt;Are you using &lt;BR /&gt;
| fillnull value=NULL fieldname | &lt;BR /&gt;
for your 'Null' results?&lt;BR /&gt;
What are you using for you 'fix' results?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 15:29:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85494#M21842</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-07T15:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85495#M21843</link>
      <description>&lt;P&gt;Try using &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fillnull value=NULL cs5 |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for your 'Null' results?&lt;/P&gt;

&lt;P&gt;And, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval cs5 = case(cs5="NULL","NULL",1=1,"fix") |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for your 'fix' replacement.  Treat text as case sensitive.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 15:38:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85495#M21843</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-07T15:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85496#M21844</link>
      <description>&lt;P&gt;Yes for the fillnull value.&lt;/P&gt;

&lt;P&gt;I've tried to just use &lt;BR /&gt;
replace [*] with [fix], but now it's giving me a search error.&lt;/P&gt;

&lt;P&gt;I'm very new to Splunk, but here's the (latest version of the) part of the query I'm trying to run.&lt;/P&gt;

&lt;P&gt;| fillnull value=NULL cs5 | replace [*] with [fix] cs5 |&lt;/P&gt;

&lt;P&gt;I know that's probably the reason that all I was getting were "fix" results because the wildcard is catching everything.  I'm not sure how to tell Splunk to differentiate between found data and NULL.  And I need a null value so that I can get Splunk to count the instances of null.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 15:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85496#M21844</guid>
      <dc:creator>CharterBT</dc:creator>
      <dc:date>2013-10-07T15:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85497#M21845</link>
      <description>&lt;P&gt;Sorry, I was probably being unclear.  &lt;/P&gt;

&lt;P&gt;The eval fieldname query you suggested didn't replace any found data with the word "fix".&lt;/P&gt;

&lt;P&gt;The fieldname that I'm focusing on could capture any combination of letters or numbers - if there's data in the field, I need to replace it with the word "fix".  I don't need to retain the data, I just need a count.&lt;/P&gt;

&lt;P&gt;If there's no data, I need the word "null" in that field.  Then I can get a count of those as well.&lt;/P&gt;

&lt;P&gt;This seems like it should be an easy query, but then again, these really basic queries can sometimes be harder than I think.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 15:46:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85497#M21845</guid>
      <dc:creator>CharterBT</dc:creator>
      <dc:date>2013-10-07T15:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85498#M21846</link>
      <description>&lt;P&gt;Try case instead.  The 1=1 is a default true that should match all non-NULL values.  The NULL values will not make it to the end of the statement, so they should be ok.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 15:58:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85498#M21846</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-07T15:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85499#M21847</link>
      <description>&lt;P&gt;Easy enough. So first, fill in your nulls with a value to check. Then in your stats, match on those that are null, and those that aren't null.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your_search | fillnull value="nullify" FIELDNAME | stats count(eval(searchmatch("FIELDNAME='nullify'"))) AS FOUND_NULL count(eval(searchmatch("FIELDNAME!='nullify'"))) AS FOUND_DATA&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;EDIT: updated searchmatch to make sure you are matching on the field. Per docs, searchmatch argument is a search string.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 16:04:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85499#M21847</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-10-07T16:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85500#M21848</link>
      <description>&lt;P&gt;There's probably another way of doing it too...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex mode=sed field=foo "s/^.+$/fix/"
| eval foo=coalesce(foo,"NULL") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Oct 2013 16:18:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85500#M21848</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2013-10-07T16:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85501#M21849</link>
      <description>&lt;P&gt;OK, I realize that in your first example, I change fieldname to actual name of the field (in my case, cs5).  Do I change the word "case" in your second example?  I ask because I ran it "as-is" for the second example, and I still was unable to get results that group into the two types I need.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 18:20:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85501#M21849</guid>
      <dc:creator>CharterBT</dc:creator>
      <dc:date>2013-10-07T18:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85502#M21850</link>
      <description>&lt;P&gt;This is the closest I've gotten to the results I need, because it created two columns labeled "Found Null" and "Found Data".  But it grouped all the results under Found Data, and my previous queries have 70%+ of my results have  null.  I replaced FIELDNAME with the name of the field I'm wanting to change/count.  What other part of this example do I have to change for this to work?  I'm not familiar with searchmatch.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 18:25:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85502#M21850</guid>
      <dc:creator>CharterBT</dc:creator>
      <dc:date>2013-10-07T18:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85503#M21851</link>
      <description>&lt;P&gt;Can you post the actual fieldname, and the search you just tried?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 18:27:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85503#M21851</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-10-07T18:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85504#M21852</link>
      <description>&lt;P&gt;Sorry, yes the fieldname should be cs5, and you need to add quotes to the text in the  case statement.  No quotes around numbers or field names.  I updated the answer.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 18:37:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85504#M21852</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-07T18:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85505#M21853</link>
      <description>&lt;P&gt;BINGO!  That did it!  Thanks for your help and teaching me a new trick in Splunk, too!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 19:05:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85505#M21853</guid>
      <dc:creator>CharterBT</dc:creator>
      <dc:date>2013-10-07T19:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: replace found data with "fix" and no data with "NULL"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85506#M21854</link>
      <description>&lt;P&gt;lukejadamec got it to work for me, but thanks for all of your help as well!  Have a great day!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 19:07:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-found-data-with-quot-fix-quot-and-no-data-with-quot-NULL/m-p/85506#M21854</guid>
      <dc:creator>CharterBT</dc:creator>
      <dc:date>2013-10-07T19:07:54Z</dc:date>
    </item>
  </channel>
</rss>

