The code is a python flask app:
import json
from flask import request
from flask import Flask, redirect
app=Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
    if request.method == 'POST':
        data=request.get_json()
        print(data)
        with open('yourpath/alerts.json','a') as f:
            json.dump(data,f)
        return redirect('/')
    else:
        return "nothing"
if __name__=='__main__':
    app.run()




On Monday, 6 April 2020 12:20:16 UTC+5:30, Adarsh Kumar Pandey wrote:
>
> I saw that alertmanager generates a nflog file ..I was wondering how that 
> works and can i get all the alerts fired from that log file?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/3b6a09d1-cb4b-490a-a16a-65ed9207b18d%40googlegroups.com.

Reply via email to