Getting Data In

i am trying to collect event metrics from application logs from splunk for prometheus. Can anyone please guide me how to do ?

iamlucky92
Observer

For eg via below code i get the logs but how to get metrics from them and how i can use them in prometheus ?

import splunklib.client as client
import splunklib.results as results
service = client.connect( 
                host='host', 
                port=8089,
                username='usr',
                password='pwd')

query="search index=some index"
#rr = results.ResultsReader(service.jobs.export(query))
kwargs_export = { "output_mode": "json"}
rr = service.jobs.export(query)

for item in rr:
    print(item)
Tags (2)
0 Karma

p_gurav
Champion

Please try Prometheus Metrics for Splunk app.
https://splunkbase.splunk.com/app/4077/

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...