<?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 How to edit my search to determine if a field has a null or blank value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-determine-if-a-field-has-a-null-or/m-p/276069#M83279</link>
    <description>&lt;P&gt;I'm trying to determine whether a field has a value but my search isn't giving me expected results, I've tried this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search ... | eval agentOrClient = if(detail.agentRefNo == "", "client", "agent") | table agentOrClient
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This always returns agent even though the field is blank&lt;BR /&gt;
I have also tried isnull and that gives the same result&lt;/P&gt;</description>
    <pubDate>Fri, 03 Feb 2017 10:52:01 GMT</pubDate>
    <dc:creator>dan_pudwell</dc:creator>
    <dc:date>2017-02-03T10:52:01Z</dc:date>
    <item>
      <title>How to edit my search to determine if a field has a null or blank value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-determine-if-a-field-has-a-null-or/m-p/276069#M83279</link>
      <description>&lt;P&gt;I'm trying to determine whether a field has a value but my search isn't giving me expected results, I've tried this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search ... | eval agentOrClient = if(detail.agentRefNo == "", "client", "agent") | table agentOrClient
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This always returns agent even though the field is blank&lt;BR /&gt;
I have also tried isnull and that gives the same result&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 10:52:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-determine-if-a-field-has-a-null-or/m-p/276069#M83279</guid>
      <dc:creator>dan_pudwell</dc:creator>
      <dc:date>2017-02-03T10:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to determine if a field has a null or blank value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-determine-if-a-field-has-a-null-or/m-p/276070#M83280</link>
      <description>&lt;P&gt;To test for NULL or blank use the following instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search ... 
| eval agentOrClient = if('detail.agentRefNo' == "" OR isNull('detail.agentRefNo'), "client", "agent") 
| table agentOrClient
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also because of the dot in your field name it is a good practise to use single quotes when referring to the field name from within an eval statement.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 11:20:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-determine-if-a-field-has-a-null-or/m-p/276070#M83280</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2017-02-03T11:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to determine if a field has a null or blank value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-determine-if-a-field-has-a-null-or/m-p/276071#M83281</link>
      <description>&lt;P&gt;perfect, thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 11:29:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-determine-if-a-field-has-a-null-or/m-p/276071#M83281</guid>
      <dc:creator>dan_pudwell</dc:creator>
      <dc:date>2017-02-03T11:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to determine if a field has a null or blank value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-determine-if-a-field-has-a-null-or/m-p/276072#M83282</link>
      <description>&lt;P&gt;No worries. Please don't forget to mark this as answered if you like the response so that others can benefit from it in future.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 11:50:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-determine-if-a-field-has-a-null-or/m-p/276072#M83282</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2017-02-03T11:50:32Z</dc:date>
    </item>
  </channel>
</rss>

