Splunk Search

How to extract this field from my Active Directory data into a different field name?

ccsfdave
Builder

In my Active Directory data I have this situation:

Subject:
    Security ID:        NT AUTHORITY\SYSTEM
    Account Name:       ADDC01
    Account Domain:     AD
    Logon ID:       0x3e7
Account That Was Locked Out:
    Security ID:        MyDomain\Lightning.McQueen
    Account Name:       lightning.mcqueen

I would like to extract ADDC01 into a different field name e.g. Server_Account so that I can isolate which are users and which are servers.

Any help would be greatly appreciated!

0 Karma
1 Solution

cmccririe
Splunk Employee
Splunk Employee

Assuming the Windows TA extracts Account Name into a multi-valued field. On my test machine, I have a field called Account_Name that has been extracted for both of these values.

Use the mvindex() function to reference a specific value in a multivalue field. Since the index numbering starts at 0 you will use the following two eval statements.

  1. |eval Server_Account = mvindex(Account_Name,0)
  2. |eval User_Account = mvindex(Account_Name,1)

View solution in original post

cmccririe
Splunk Employee
Splunk Employee

Assuming the Windows TA extracts Account Name into a multi-valued field. On my test machine, I have a field called Account_Name that has been extracted for both of these values.

Use the mvindex() function to reference a specific value in a multivalue field. Since the index numbering starts at 0 you will use the following two eval statements.

  1. |eval Server_Account = mvindex(Account_Name,0)
  2. |eval User_Account = mvindex(Account_Name,1)
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...