Getting Data In

trouble with extracting data from JSON event

lwiechec
New Member

Hi, I am storing the events containing subscribers per subscription topics.

The events look like this:

{"type":"subscriptions","details":{"topic":"topic1","subscribers":["192.168.74.25","10.132.45.54"]}}
...
{"type":"subscriptions","details":{"topic":"topic2","subscribers":["192.168.74.26","10.132.45.54"]}}
...

I want to count all subscriptions per subscribers and plot it over time.

Until now I managed to extract the list of subscribers using this Splunk query:

source="mysource" | chart values(details.subscribers{}) as subscribers

I guess I should now use it in subquery ?

Any help would be appreciated!

Thanks,
L.

0 Karma

kmaron
Motivator

This would get you the number of events, which I think is what you mean by subscriptions, per subscriber over time.

source="mysource" | eval rename details.subscribers{} as subscribers | mvexpand subscribers | timechart count by subscribers
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...