Splunk Search

How to remove field values

syed_star357
New Member

Hi,

I want to remove source and source type field value of

Unix:Service
Unix:Uptime
Unix:Version
package
ps

Please help me, how to remove the mentioned field.
Screenshot is attached![alt text][1]

Tags (1)
0 Karma
1 Solution

javiergn
SplunkTrust
SplunkTrust
index=linux* 
NOT (sourcetype = "Unix:Service" OR sourcetype = "Unix:Uptime" OR sourcetype = "Unix:Version" OR sourcetype = "package" OR sourcetype = "ps") 
NOT (source = "Unix:Service" OR source = "Unix:Uptime" OR source = "Unix:Version" OR source = "package" OR source = "ps")
| stats max(_time) .... REST OF QUERY HERE

Let me know if that's what you need

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If by "remove" you intend to delete the data from the Splunk index, then it can't be done. Data in Splunk cannot be modified.
On the other hand, you may be wanting to not show certain fields. That is done with the fields command.

... | field - Unix:Service Unix:Uptime Unix:Version package ps
---
If this reply helps you, Karma would be appreciated.

javiergn
SplunkTrust
SplunkTrust
index=linux* 
NOT (sourcetype = "Unix:Service" OR sourcetype = "Unix:Uptime" OR sourcetype = "Unix:Version" OR sourcetype = "package" OR sourcetype = "ps") 
NOT (source = "Unix:Service" OR source = "Unix:Uptime" OR source = "Unix:Version" OR source = "package" OR source = "ps")
| stats max(_time) .... REST OF QUERY HERE

Let me know if that's what you need

0 Karma

syed_star357
New Member

Thanks, I got the answer for the same query.

0 Karma

sundareshr
Legend

Try this

index=linux* NOT (sourcetype=UNIX* OR source=UNIX*) | stats latest(_time) as last_time by host source sourcetype | ....
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 ...