Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Extract information from alerts

Jean-Pierre KELLER November 18, 2021

Hello,

When I extract the information from the alerts in Opsgenie, I would like to add the "tags" in the generated CSV file. How should I proceed?
Thank you

Cordially

Jean-Pierre KELLER

1 answer

1 vote
Zeeshan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 18, 2021

Hey Jean-Pierre,

When you download the CSV file generated from the Alerts List page in Opsgenie GUI, it contains information on limited fields, not including the tags field.

Therefore, if you would like to extract the Alerts List with all the information, I would suggest using the List Alerts API: https://docs.opsgenie.com/docs/alert-api#list-alerts where you can list multiple alerts with information on more alert fields, including tags.

As the resulting data is in JSON and you would like a CSV, you can use a simple JSON to CSV convertor to get the data in a CSV for example this online tool here: https://www.convertcsv.com/json-to-csv.htm

Regards,
Zeeshan from Opsgenie Support

Zeeshan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 18, 2021

Furthermore, would just like to add that we do have a Feature Request [ALX-3217] which would allow customizing the fields you can add in the CSV that can be then directly generated from the Opsgenie GUI. I shall update you here once it is implemented.


Please note that our Product team reviews all feature requests together and they prioritize those with higher demand to be implemented first and any feature requests will take months until is ready since it needs to go through Design, Development, Testing, and rolling out to Production.

Further, every feature requests tickets are logged on our internal system without public access for our customers.

Jean-Pierre KELLER November 21, 2021

How do I integrate my filter in the query: "description: Threshold of 98% reached for the service"
'https://api.opsgenie.com/v2/alerts?query=description: 98% threshold reached for the service' gives me a "bad request" error

Zeeshan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 22, 2021

Hey Jean-Pierre,

You can try the following:

https://api.opsgenie.com/v2/alerts?query=description%3A%2298%25%22

Jean-Pierre KELLER November 22, 2021

sorry this URL doesn't open

{"message":"Could not authenticate","took":0.0,"requestId":"aa703b86-d0f3-4607-9651-704fc3a15eea"}
Zeeshan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 22, 2021

It could be that your account is in the EU region. Hence you can try: 

https://api.eu.opsgenie.com/v2/alerts?query=description%3A%2298%25%22

Jean-Pierre KELLER November 22, 2021

same result :

{"message":"Could not authenticate","took":0.001,"requestId":"b3edb3c6-3068-4853-8198-e6570b1cd465"}
Zeeshan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 22, 2021

Hey Jean-Pierre,

If you are directly running this API query in the browser you will need to add the apiKey parameter as well and define an API key from your account there the following way:

https://api.opsgenie.com/v2/alerts?query=description%3A%2298%25%22&apiKey=XXX-XX-XXX

or for EU:

https://api.eu.opsgenie.com/v2/alerts?query=description%3A%2298%25%22&apiKey=XXX-XX-XXX

Like Steffen Opel _Utoolity_ likes this
Jean-Pierre KELLER November 22, 2021

it works.
thanks a lot for your help

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events