Splunk Search

How to extract values in a field?

mdmaala
Communicator

In my table, I have a field named Username, and it has two values: Machine 1 and 2. I only want to show Machine1 only without showing Machine2. How would I do this? thanks!

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Add | search Username=Machine1 to your query.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

woodcock
Esteemed Legend

Like this:

... | eval Username = mvindex(Username, 0)
0 Karma

mdmaala
Communicator

I did this but it still shows both machine 1 and 2

0 Karma

renjith_nair
Legend

@mdmaala,

Is it a multi value field or delimiter(comma,space,etc) separated? Can you share some sample events of the field?

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Add | search Username=Machine1 to your query.

---
If this reply helps you, Karma would be appreciated.
0 Karma

mdmaala
Communicator

I did this and this works! but in my graph it still leaves a gap for machine 2 values for every timestamp registered, is there anyway that I can remove that in the graph and show the values for machine 1 only?

0 Karma

mdmaala
Communicator

thanks! I was able to search only for Machine1 values. but in my graph it still leaves a space for machine 2. I only want to graph values for machine 1

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...