Splunk Search

splunk search

sriva6
New Member

Hi,

I have application logs which read something like this
Blah bla blah File Descriptor: 1234
Blah bla blah File Descriptor: 5678
.
.
.

I have added the log file data to my spunk server and now I want to use splunk to get a trend of the number of file descriptors in a chart. I do not want the number of times the string "file descriptors" appaears in the logs instead i want the value of the file descriptor. Please let me how can I do this?

Tags (1)
0 Karma

reed_kelly
Contributor

You can either parse the file descriptor in props.conf or use the rex command to parse it in the search. For example, if you are trying to get a time chart of the number of distinct file descriptors used in each hour, then you could use something like the following:

index=xxx ... |rex field=_raw "File\sDescriptor:\s+(?<file_descriptor>\d+)" |timechart span=1h dc(file_descriptor)

Of course, this has to be used in a chart of some sort.

0 Karma

lguinn2
Legend

Try this

yoursearchhere
| rex "File Descriptor:\s(?<fileDescriptor>\S+)"
| timechart count by fileDescriptor

Or

yoursearchhere
| rex "File Descriptor:\s(?<fileDescriptor>\S+)"
| chart count by fileDescriptor

The rex command creates a field called fileDescriptor that can be used in the commands that follow in the pipeline.

0 Karma

jangid
Builder

try

| chart values(fileDescriptor)

0 Karma

sriva6
New Member

hi,

I tried this but this is giving me a count of the number of times a particular Field Descriptor value appears in the logs but I want to get the list of all the field descriptor values in the logs and plot a graph/chart to show the trend of the descriptors over a time

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...