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

@mdmaala,

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

Happy Splunking!
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
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 ...