<?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: How to populate a null field if certain field equals *** in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483837#M135459</link>
    <description>&lt;P&gt;Should there be at the end “,1=1, dest_port)” ?&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2020 20:59:52 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2020-02-27T20:59:52Z</dc:date>
    <item>
      <title>How to populate a null field if certain field equals ***</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483835#M135457</link>
      <description>&lt;P&gt;Hi Folks&lt;/P&gt;

&lt;P&gt;Have an issue where some of my log entries contain null fields in which i need to populate in order to run stats against.&lt;/P&gt;

&lt;P&gt;From the csv dump below, dest_port is empty so i need to basically say:&lt;/P&gt;

&lt;P&gt;where rule=SSH-ACL, polulate empty dest_port field with a value of 22&lt;BR /&gt;
where rule=NTP-ACL, polulate empty dest_port field with a value of 123&lt;/P&gt;

&lt;P&gt;thanks in advance.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/284602-splunkpost.jpg" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:25:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483835#M135457</guid>
      <dc:creator>smithjnick</dc:creator>
      <dc:date>2020-09-30T04:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate a null field if certain field equals ***</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483836#M135458</link>
      <description>&lt;P&gt;Try &lt;CODE&gt;case&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval dest_port = case (rule=SSH-ACL AND isnull(dest_port), 22, rule=NTP-ACL AND isnull(dest_port), 123, 1==1, dest_port)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Feb 2020 20:55:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483836#M135458</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-02-27T20:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate a null field if certain field equals ***</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483837#M135459</link>
      <description>&lt;P&gt;Should there be at the end “,1=1, dest_port)” ?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 20:59:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483837#M135459</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-02-27T20:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate a null field if certain field equals ***</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483838#M135460</link>
      <description>&lt;P&gt;Yes.  Updated.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 21:24:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483838#M135460</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-02-27T21:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate a null field if certain field equals ***</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483839#M135461</link>
      <description>&lt;P&gt;Thank you Rich.&lt;/P&gt;

&lt;P&gt;Not currently giving me the desired output but the case command has now given me some food for thought.  Thank you for the pointer and will report back with my outcome.&lt;/P&gt;

&lt;P&gt;cheers&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 12:07:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483839#M135461</guid>
      <dc:creator>smithjnick</dc:creator>
      <dc:date>2020-02-28T12:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate a null field if certain field equals ***</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483840#M135462</link>
      <description>&lt;P&gt;Well, I'd use this slightly modified version&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | eval dest_port = case (rule="SSH-ACL" AND isnull(dest_port), 22, rule="NTP-ACL" AND isnull(dest_port), 123, 1==1, dest_port)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Feb 2020 13:35:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483840#M135462</guid>
      <dc:creator>jpalacian</dc:creator>
      <dc:date>2020-02-28T13:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate a null field if certain field equals ***</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483841#M135463</link>
      <description>&lt;P&gt;Yep JP - that fixed the issue - those damn quotation marks.&lt;/P&gt;

&lt;P&gt;thank you muchly and have a great weekend.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 13:48:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-a-null-field-if-certain-field-equals/m-p/483841#M135463</guid>
      <dc:creator>smithjnick</dc:creator>
      <dc:date>2020-02-28T13:48:50Z</dc:date>
    </item>
  </channel>
</rss>

