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!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...