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!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

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 ...