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

Script to extract alerts

Jugal_Shroff August 18, 2022

Hi Team,

I want to extract alerts data on weekly basis is it possible through scripting or any other method to automate get this data automatically on every Monday.

2 answers

1 vote
Tom Russell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 23, 2022

We regularly export alert data to our enterprise data lake, then run reports against the data there. It allows us a lot of flexibility to tailor and customize reports that are not available in Opsgenie Analytics. We do this by:

  • Running an OEC that writes each alert to a JSON file in temporary storage (with AlertID as the name) every time it is touched. As part of this process, we make additional API calls to get responder names and note, since they are not returned when the alert data is requested.
  • When an alert JSON file has been untouched for more than 15 minutes (often most of the activity takes place in the first 15 minutes), we upload it to our data lake for further analysis and delete it from temporary storage. This allows us fairly quick access to the data without too many duplicate records arriving in the data lake.

This has proven to be fairly successful for us, though there is still data that we plan to add by analyzing the logs:

  • Details on usage patterns of each integration
  • Adding the integration that closed an alert, so we can know if it was closed by a responder in the GUI or by an automated process
  • Adding all of the notifications that an alert generated, allowing us to report on notifications by team, by machine, or by other subgroup. This will also allow us to find alerts that generate a notification, but are closed by an automated process shortly after notifying. These are alerts that we can add delays to the notification policies (I hate getting notified at 3am, and by the time I get into the system, the alert had cleared)
Chris DeGidio
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 20, 2022

@Tom Russell 

thanks for sharing your use case there. Definitely awesome to see. 

 

- Chris 

0 votes
Chris DeGidio
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 19, 2022

Hi @Jugal_Shroff 

Welcome to the community! We actually have a command line utility that you could automate on a system like a cron job. This is documented here: https://docs.opsgenie.com/docs/lamp-command-line-interface-for-opsgenie , but you would potentially have to account for pagination if querying for many alerts.

Additionally, our other APIs are documented within that web page as well so the possibilities are endless on what you can write custom and run on your end. 

It is worth mentioning that we do have a feature request filed for the ability to schedule the drill-down data for our scheduled reports mechanism, meaning that when released you would be able to schedule the drill-down data that you are able to export within Opsgenie. I put together a quick video showing what I am talking about here: https://share.getcloudapp.com/OAuj9AEw The feature request for further tracking on this would be here

Please let us know if you have any further questions or concerns. 

- Chris

Suggest an answer

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

Atlassian Community Events