Splunk Search

Can not get rid of a blank field.


Hello fellow Splunkers,

I am having this problem where i can not get rid of a field that shows up blank with no information in it. I have tried several ways to void out the blank space from the results table but have not had much luck. (I have tried saying that NOT (Account_Name="" OR User_Name="") along with other trys.)

Any help or sugestions would be greatly appreachiated.

index= "windows" source="wineventlog:security" NOT (Account_Name="NETWORK SERVICE" OR Account_Name="LOCAL SERVICE" OR Account_Name="*$" OR Account_Name="*lid*" OR User_Name="" OR Account_Name="" OR User_Name="lid*" OR User_Name="adm*" OR Account_Name="adm*") EventCode=529 OR EventCode=4625 | rex field=_raw "Account For Which Logon Failed:\W\s+\w+\W\S+\W\W+\S+\W\S+\W\s+\w+\W\w+:\W\W(?<cname>.+?)\W" |rex field=_raw "User Name:(?<cname>.+?)\W"| top limit=0 cname

The picture below will show that the fifth field has 45 hits, but no cname field. How do i void this/ get this out of my report?

alt text

Below is the source event for the blank space that I am trying to void out of my report because it is generating to much data. I thank you so much for all the help you guys are willing to provide.

10/18/2012 12:16:49 PM
SourceName=Microsoft Windows security auditing.
Keywords=Audit Failure
Message=An account failed to log on.

Security ID: NULL SID
Account Name: -
Account Domain: -
Logon ID: 0x0

Logon Type: 3

Account For Which Logon Failed:
Security ID: NULL SID
Account Name:

Account Domain:

Failure Information:
Failure Reason: An Error occured during Logon.
Status: 0x80090308
Sub Status: 0x0

Process Information:
Caller Process ID: 0x0
Caller Process Name: -

Network Information:
Workstation Name:

Source Network Address: -
Source Port: -

Detailed Authentication Information:
Logon Process:

Authentication Package: NTLM
Transited Services: -
Package Name (NTLM only): -
Key Length: 0

This event is generated when a logon request fails. It is generated on the computer where access was attempted.

The Subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.

The Logon Type field indicates the kind of logon that was requested. The most common types are 2 (interactive) and 3 (network).

The Process Information fields indicate which account and process on the system requested the logon.

The Network Information fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.

The authentication information fields provide detailed information about this specific logon request.
- Transited services indicate which intermediate services have participated in this logon request.
- Package name indicates which sub-protocol was used among the NTLM protocols.
- Key length indicates the length of the generated session key. This will be 0 if no session key was requested.
10/18/2012 12:16:49 PM

Tags (1)
0 Karma


Create a new field set to the value of the field you may want to get rid of then get rid of that field name, e.g.

say the field in question is named "possiblynull"

| eval maybenull=possiblynull
| fields - possiblynull
| rename maybenull as possiblynull

This way, if the original field is actually empty, your search results will not end up with it present.

In my case, I needed to use rex to extract a "message" field that may or may not be present in an event, but if it was it could be really dirty (since it's user-generated text). However, rex has the side effect of always creating the field you specify, even if there is no actual match in the event. As a result, every search had that rex-extracted field name, which was not desired.

New Member

This is great. Thanks

0 Karma

New Member

For me only below worked:
| where isnotnull(my_user_id)| table my_user_id

0 Karma


There could be all sorts of non-printable characters in there.

stick this at the end of your search

| where match(cname,"[a-zA-Z0-9]")

This does assume there's at least 1 alphanumeric character in valid usernames.

You can refine the regex once you narrow down whats actually in cname


this worked for me . thanks

0 Karma

Splunk Employee
Splunk Employee

what about replacing it : | fillnull value="missing" cname
or removing it : | where NOT (cname="" OR cname=" ")

But this is strange that you have 2 rex commands to extract the same field "cname" , don't the last one erase the first one ? You maybe should use 2 fields and add an eval to compare them at the end and pick the not null.


I have updated and edited the question with the event source code. THX

0 Karma

Splunk Employee
Splunk Employee

If this is a regex issue, please post the full event to test it.


I am still having trouble getting this to work. Does anyone have any other suggestions? I thank you yannK. I dont know why it wont work this way.

0 Karma

Splunk Employee
Splunk Employee

after the field extractions, before the top


Where exactly do i put that in my search string, and no i dont believe it does replace the first one because one is comming through as eventcode 529 and the other is comming through as 4625....... I am having trouble trying to get the search to get rid of the 'blank' field.

0 Karma