Getting Data In

How can I retrieve the number of connections for collectd using the REST API?

dhavalv20
Engager

Hello,

Currently, I am trying to extract the connections realted data using REST API and I am aware that the required data is present at location services/server/introspection/kvstore/serverstatus?output_mode=json . However, the information that I need is a "value" of key "data" which is a "JSON" string in format as shown below:

{
 ..
..
  entry [ 
    content : {
      data: "connection:{total:10,current:1,.. }
    }
 ]
..
..
}

I'm using collectd curl_json plugin which can look into json format for key => value pair. However, since the data (key) has the json string (value ), I'm unable to do any further parsing to extract the useful data.

I have been wondering if there is any way so that i can retrieve only the value of data field using the REST API, another place from where I can get the exact value, or any other possible method with which I can get this value in json format?

Finally, as an API user, I am struggling to understand why the data key has a value of json string .. instead of simply having that as json data, it would have made things lot more manageable.

Thanks for your help in advance.

Tags (3)
0 Karma
1 Solution

dhavalv20
Engager

I could not find any answers , so i end up writing the collectd python plugin which will solve this problem ( as long as the json stays in the data field/key) .

For those, who are looking for similar solution , here is the link to collectd splunkData plugin https://github.com/dvadgama/collectd_splunkData

Regards
Dhaval Vadgama

View solution in original post

0 Karma

dhavalv20
Engager

I could not find any answers , so i end up writing the collectd python plugin which will solve this problem ( as long as the json stays in the data field/key) .

For those, who are looking for similar solution , here is the link to collectd splunkData plugin https://github.com/dvadgama/collectd_splunkData

Regards
Dhaval Vadgama

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...