Splunk Search

Is it possible to hide the filed value for one index but keep it for the other index?

MeMilo09
Path Finder

Hey Guys, 

I am new to Splunk, and want to know if there is an easy way of hiding the value of one filed from one index but keeping it on the other. Both indexes have the same field devApp and color.  I tried NOT and and also color!=blue  that removes the entire event coming from the oranges index. I need both events from both indexes. How can I remove the color filed value from the devApp=XML, while still including the event?

 

(index = "oranges"  (devApp=XML color!=blue)  OR  (devApp=HMTL color=blue))

Labels (4)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The search command

(index = "oranges"  (devApp=XML color!=blue)  OR  (devApp=HMTL color=blue))

tells Splunk you want to fetch all events from the "oranges" index with the specified criteria.  Events are always fetched in their entirety.  Anything you want or need to do with individual fields must be done with other commands.

We can't remove individual fields, but we can override them.  Like this:

(index = "oranges"  (devApp=XML color!=blue)  OR  (devApp=HMTL color=blue))
| eval color=if(devApp=XML,null,color)

 

---
If this reply helps you, Karma would be appreciated.
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 ...

Wondering How to Build Resiliency in the Cloud?

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

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...