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!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...