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
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...