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!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

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

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...