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 (3)
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!

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...