Security

LDAP Query: Pull the Description and Office fields within AD

itsmevic
Communicator

Hi,

I need to pull the description and office fields in active directory in my SPL query. What would be the best syntax to use. What I am doing is simply a basic string search for "TOR" and would like the results to list also the user's description and office field values within AD.

Current Search:

index=* sourcetype=* "TOR"
|stats count by user
|ldapfilter search="(&(objectclass=user)(!(objectClass=computer))(samAccountName=$samAccountName$))" attrs="description, physicalDeliveryOfficeName"
|sort -count
0 Karma

mydog8it
Builder

I don't have experience with this command, but the examples in the documentation show outputting to the "table" command. You might want to try adding:

| table user,description,physicalDeliveryOfficeName,count

ahead of the sort

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...