Getting Data In

How to dedup a field inside JSON arrays?

jravida
Communicator

Hi guys,

I'm working on some formulas to show percentages, right now trying to count % vendors affected by vulnerabilities. The data I am working with is a single JSON file, broken down into each Vulnerability ID. Problem is, if I try to dedup a Vendor that is affected by a particular vulnerability (which are listed as vendor, product, version, inside separate JSON sub-arrays within the vulnerability ID), it still counts the multiple versions, even though I:

index = jsonvuln | dedup id Vendor | top 100 Vendor

returns > 100% for Vendors like Apple and Adobe, which show up multiple times in each Vulnerability ID. So like 236.76% for Adobe.The dedup doesn't seem to work for the array within the event. Is there a command I can use to dedup these Vendors so Splunk only counts it once?

Tags (2)
0 Karma
1 Solution

jravida
Communicator

Figured it out.

I have to use mvexpand on the Vendor field. Then dedup Vendor and ID fields. So simple!

View solution in original post

0 Karma

jravida
Communicator

Figured it out.

I have to use mvexpand on the Vendor field. Then dedup Vendor and ID fields. So simple!

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

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