Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,942
Community Members
 
Community Events
168
Community Groups

Script to extract alerts

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

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)

@Tom Russell 

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

 

- Chris 

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
Community showcase
Published in Jira

Online AMA this week: Your project management questions answered by Jira Design Lead James Rotanson

We know that great teams require amazing project management chops. It's no surprise that great teams who use Jira have strong project managers, effective workflows, and secrets that bring planning ...

197 views 1 6
Read article

Atlassian Community Events