# How do I pull the last 3 months of historical data from all of the alarms in a tag provider?

**URL:** <https://forum.inductiveautomation.com/t/how-do-i-pull-the-last-3-months-of-historical-data-from-all-of-the-alarms-in-a-tag-provider/110550>\
**Category:** Ignition\
**Created:** [September 11, 2025, 6:59pm UTC](https://forum.inductiveautomation.com/t/how-do-i-pull-the-last-3-months-of-historical-data-from-all-of-the-alarms-in-a-tag-provider/110550 "2025-09-11T18:59:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guillermo\_Piedra](https://avatars.discourse-cdn.com/v4/letter/g/ce73a5/32.png) [@Guillermo\_Piedra](https://forum.inductiveautomation.com/u/Guillermo_Piedra)\
**Post date:** [September 11, 2025, 6:59pm UTC](https://forum.inductiveautomation.com/t/how-do-i-pull-the-last-3-months-of-historical-data-from-all-of-the-alarms-in-a-tag-provider/110550/1 "2025-09-11T18:59:37Z")

</div>

Hi all, I got a request to obtain all of the historical data of our alarms from the last 3 months and if possible download to a CSV/Excel file. Is this possible? And if so, how?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [September 11, 2025, 7:07pm UTC](https://forum.inductiveautomation.com/t/how-do-i-pull-the-last-3-months-of-historical-data-from-all-of-the-alarms-in-a-tag-provider/110550/2 "2025-09-11T19:07:43Z")

</div>

You'll need to script something to use [`system.alarm.queryJournal`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-alarm/system-alarm-queryJournal) to fetch the alarm data. The return format is a list of [`pyAlarmEvents`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/reference-pages/scripting-object-reference#pyalarmevent), you'll likely need to loop through this to pick out the information you want to export.

From there, convert it to an excel or csv format, and write it to a file using [`system.file.writeFile`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-file/system-file-writeFile)

If you assemble your data you plan to export into a dataset, you can pass it to [`system.dataset.exportExcel`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-dataset/system-dataset-exportExcel) or [`system.dataset.exportCSV`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-dataset/system-dataset-exportCSV) to have Ignition handle the conversion and file writing for you.
