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!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...