Splunk Search

How to remove only a single value when there are more multiple same values are present in a field?

diliptmonson
Explorer

Hi ,

I am trying to update a multivalued field in a KV store. So let's say there are 3 values in the field:

A,B,A. During the update, I would want to remove A from the field. However, I want to remove only one instance of A and not all the instances.

Can anyone help me out with how to implement this logic in Splunk?

0 Karma

sundareshr
Legend

Try this..

.... | streamstats count | mvexpand mvfieldinkvstore | dedup count mvfieldinkvstore | mvcombine mvfieldinkvstore | fields - count
0 Karma

somesoni2
Revered Legend
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...