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!

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 ...