<?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 extract a field with a NULL/blank value in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-extract-a-field-with-a-NULL-blank-value/m-p/484066#M7907</link>
    <description>&lt;P&gt;I am working with winevent logs for failed logons (Event 4625) and I have a log that has null/blank values for Account and Domain. When I try to extract the field I can see in the IFX that it is being grabbed as what seems to be a null/blank value using my regex below. When I save the extraction all of the other fields I am extracting works but the Account and Domain field are not being assigned a value of anything and not showing up as an extracted field. My question is how do I extract a null/blank value from a log and have Splunk still recognize it as a field with a null/blank value.&lt;/P&gt;

&lt;P&gt;The regex I am using is:&lt;/P&gt;

&lt;P&gt;(?s)EventCode=4625.+?ComputerName=(?[^\s]+).+?Logon Type:\s+(?\d).+?Account Name:\s+(?[^\r\n]&lt;EM&gt;)\sAccount Domain:\s+(?[^\r\n]&lt;/EM&gt;)(Failure Reason:).+?Caller Process Name:\s+(?[^\s]+).+?Workstation Name:\s+(?[^\s]+).+?Source Network Address:\s+(?[^\s]+).+?Source Port:\s+(?[^\s]+)&lt;/P&gt;

&lt;P&gt;The log looks like this:&lt;/P&gt;

&lt;P&gt;11/15/2019 12:36:54 PM&lt;BR /&gt;
EventCode=4625&lt;BR /&gt;
ComputerName=somehost&lt;BR /&gt;
Message=An account failed to log on.&lt;BR /&gt;
Security ID:        DOMAIN\someuser&lt;BR /&gt;
Account Name:       someuser&lt;BR /&gt;
Account Domain:     DOMAIN&lt;BR /&gt;
Logon ID:       0x0000000&lt;BR /&gt;
Logon Type:         3&lt;BR /&gt;
Account For Which Logon Failed:&lt;BR /&gt;
Security ID:        NULL SID&lt;BR /&gt;
Account Name:&lt;BR /&gt;&lt;BR /&gt;
Account Domain:&lt;BR /&gt;&lt;BR /&gt;
Failure Reason:     An Error occured during Logon.&lt;BR /&gt;
Status:         0x00000000&lt;BR /&gt;
Sub Status:     0x0&lt;BR /&gt;
Caller Process ID:  0x0000&lt;BR /&gt;
Caller Process Name:    C:\Windows\System32\someprocess.exe&lt;BR /&gt;
Workstation Name:   somehost&lt;BR /&gt;
Source Network Address: -&lt;BR /&gt;
Source Port:        -&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2019 21:47:36 GMT</pubDate>
    <dc:creator>HunterJD</dc:creator>
    <dc:date>2019-11-15T21:47:36Z</dc:date>
    <item>
      <title>How to extract a field with a NULL/blank value</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-extract-a-field-with-a-NULL-blank-value/m-p/484066#M7907</link>
      <description>&lt;P&gt;I am working with winevent logs for failed logons (Event 4625) and I have a log that has null/blank values for Account and Domain. When I try to extract the field I can see in the IFX that it is being grabbed as what seems to be a null/blank value using my regex below. When I save the extraction all of the other fields I am extracting works but the Account and Domain field are not being assigned a value of anything and not showing up as an extracted field. My question is how do I extract a null/blank value from a log and have Splunk still recognize it as a field with a null/blank value.&lt;/P&gt;

&lt;P&gt;The regex I am using is:&lt;/P&gt;

&lt;P&gt;(?s)EventCode=4625.+?ComputerName=(?[^\s]+).+?Logon Type:\s+(?\d).+?Account Name:\s+(?[^\r\n]&lt;EM&gt;)\sAccount Domain:\s+(?[^\r\n]&lt;/EM&gt;)(Failure Reason:).+?Caller Process Name:\s+(?[^\s]+).+?Workstation Name:\s+(?[^\s]+).+?Source Network Address:\s+(?[^\s]+).+?Source Port:\s+(?[^\s]+)&lt;/P&gt;

&lt;P&gt;The log looks like this:&lt;/P&gt;

&lt;P&gt;11/15/2019 12:36:54 PM&lt;BR /&gt;
EventCode=4625&lt;BR /&gt;
ComputerName=somehost&lt;BR /&gt;
Message=An account failed to log on.&lt;BR /&gt;
Security ID:        DOMAIN\someuser&lt;BR /&gt;
Account Name:       someuser&lt;BR /&gt;
Account Domain:     DOMAIN&lt;BR /&gt;
Logon ID:       0x0000000&lt;BR /&gt;
Logon Type:         3&lt;BR /&gt;
Account For Which Logon Failed:&lt;BR /&gt;
Security ID:        NULL SID&lt;BR /&gt;
Account Name:&lt;BR /&gt;&lt;BR /&gt;
Account Domain:&lt;BR /&gt;&lt;BR /&gt;
Failure Reason:     An Error occured during Logon.&lt;BR /&gt;
Status:         0x00000000&lt;BR /&gt;
Sub Status:     0x0&lt;BR /&gt;
Caller Process ID:  0x0000&lt;BR /&gt;
Caller Process Name:    C:\Windows\System32\someprocess.exe&lt;BR /&gt;
Workstation Name:   somehost&lt;BR /&gt;
Source Network Address: -&lt;BR /&gt;
Source Port:        -&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 21:47:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-extract-a-field-with-a-NULL-blank-value/m-p/484066#M7907</guid>
      <dc:creator>HunterJD</dc:creator>
      <dc:date>2019-11-15T21:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field with a NULL/blank value</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-extract-a-field-with-a-NULL-blank-value/m-p/484067#M7908</link>
      <description>&lt;P&gt;So,i tested with this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   |makeresults | eval text="EventCode=4625
    ComputerName=somehost
    Message=An account failed to log on.
    Security ID: DOMAIN\someuser
    Account Name: someuser
    Account Domain: DOMAIN
    Logon ID: 0x0000000
    Logon Type: 3
    Account For Which Logon Failed:
    Security ID: NULL SID
    Account Name:
    Account Domain:
    Failure Reason: An Error occured during Logon.
    Status: 0x00000000
    Sub Status: 0x0
    Caller Process ID: 0x0000
    Caller Process Name: C:\Windows\System32\someprocess.exe
    Workstation Name: somehost
    Source Network Address: -
    Source Port: -"|rex field=text "Account Name\:+(?&amp;lt;accname&amp;gt;.*)"|table accname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I receive accname as someuser, and then i test like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | eval text="EventCode=4625
ComputerName=somehost
Message=An account failed to log on.
Security ID: DOMAIN\someuser
Account Name:
Account Domain: DOMAIN
Logon ID: 0x0000000
Logon Type: 3
Account For Which Logon Failed:
Security ID: NULL SID
Account Name:
Account Domain:
Failure Reason: An Error occured during Logon.
Status: 0x00000000
Sub Status: 0x0
Caller Process ID: 0x0000
Caller Process Name: C:\Windows\System32\someprocess.exe
Workstation Name: somehost
Source Network Address: -
Source Port: -"|rex field=text "Account Name\:+(?&amp;lt;accname&amp;gt;.*)"|table accname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I still gt accname extracted as null&lt;BR /&gt;
As long as you have the identifier Account Name and Account Domain, even if their value is null, regex will extract those fields.&lt;BR /&gt;
Are you saying there are some logs where the field name Account Name itself is missing?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2019 08:03:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-extract-a-field-with-a-NULL-blank-value/m-p/484067#M7908</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-11-16T08:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field with a NULL/blank value</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-extract-a-field-with-a-NULL-blank-value/m-p/484068#M7909</link>
      <description>&lt;P&gt;Splunk treats truly &lt;CODE&gt;null&lt;/CODE&gt; fields as through they do not exist at all.  You can counteract this after the fact with the &lt;CODE&gt;fillnull&lt;/CODE&gt; and &lt;CODE&gt;filldown&lt;/CODE&gt; commands to replace the null/empty field values with placeholder values like the string &lt;CODE&gt;"null"&lt;/CODE&gt; or anything else.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 02:37:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-extract-a-field-with-a-NULL-blank-value/m-p/484068#M7909</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-17T02:37:10Z</dc:date>
    </item>
  </channel>
</rss>

