Splunk Search

table order with eval

mikesangray
Path Finder

I've got a search that does a |table prior to doing an |eval for ldapfilter. The search results are displayed in a seemingly random order (not the order specified after |table). Is there a better way to do this so I can specify the results display order?

index=blah |table _time,UserName,displayName,IpAddress |eval ID=UserName |ldapfilter search="(&(samAccountName=$ID$))" attrs="displayName"

Note: For some reason doing the order of |table vs. |eval |ldapfilter heavily impacts search performance.

Faster (11-12 secs):

index=blah |table _time,UserName,displayName,IpAddress |eval ID=UserName |ldapfilter search="(&(samAccountName=$ID$))" attrs="displayName"

Much slower (116-117 secs):

index=blah |eval ID=UserName |ldapfilter search="(&(samAccountName=$ID$))" attrs="displayName" |table _time,UserName,displayName,IpAddress
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Do your events have a large number of fields? If so, that might explain the performance difference as the table command would reduce the number of fields to process. Try this:

index=blah |fields _time,UserName,displayName,IpAddress | eval ID=UserName |ldapfilter search="(&(samAccountName=$ID$))" attrs="displayName" |table _time,UserName,displayName,IpAddress
---
If this reply helps you, Karma would be appreciated.
0 Karma

mikesangray
Path Finder

Not a large number of fields - only 24 including host, source, and sourcetype. Putting |fields in did not help.

Here are the results from job inspector for 'command.ldapfilter'.

|table |eval |ldapfilter = 18.32 seconds
|eval |ldapfilter |table = 120.52 seconds
|fields |eval |ldapfilter |table = 120.43 seconds

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 ...