Troubleshooting
Why Ignition alarm journal logs every alarm twice
Short answer
No setting suppresses the second row: the journal writes one event row per state transition, eventtype 0 active, 1 clear, 2 acknowledged, all sharing one eventid. Feed downstream software an eventtype = 0 filtered SQL view and cap size with journal pruning instead of deleting clear rows.
On this page
- Why is every alarm in the journal database written twice?
- What does the eventtype column in alarm_events mean?
- Is there a journal setting that suppresses the clear row?
- Can I delete the clear rows to reclaim space?
- How do I give the other software one row per alarm?
- How big does the journal get, and what bounds its size?
- How do I verify one row per alarm end to end?
- Questions asked
Two rows per alarm is the journal working as designed, not a fault. The Ignition alarm journal stores one row per state transition, so every Boolean alarm that goes active and later clears writes an active row and a clear row that share one eventid. No journal setting removes the second row, because the alarm system itself needs the clear timestamp to time each state. Point the other software at a SQL view filtered to eventtype = 0, and let the journal profile's age limit bound the disk instead of deleting rows.
Why is every alarm in the journal database written twice? #
The journal is not storing the alarm twice; it stores one row per state transition, so each Boolean alarm occurrence writes an active row and a clear row that share one eventid, and no setting changes that.
Each alarm configured on a tag runs as a small state machine: it goes active when the value meets the alarm condition, clears when the value drops out, and acknowledges as a separate transition on top. The journal inserts one row into the events table for every transition, and every row belonging to one occurrence carries the same eventid, so what looks like a duplicate is the same alarm at its next state, stamped with the time of that state change. The alarm's properties are stored separately in the companion data table, keyed to each event row, so a transition writes its own property rows as well.
The active-plus-clear pair is not an Ignition quirk: older plant historians wrote the same pairs, and the knowledge-base article on fixing duplicate B and E marker entries in RSView32 datalogging resolves the same two-marker shape with the same kind of filter.
What does the eventtype column in alarm_events mean? #
In the events table, eventtype 0 is the active transition, 1 is the clear transition and 2 is the acknowledgement, and all rows of one occurrence carry the same eventid value.
| eventtype value | Transition | The row is written when |
|---|---|---|
| 0 | Active | the tag value meets the alarm condition |
| 1 | Clear | the tag value no longer meets the condition |
| 2 | Acknowledged | an operator or an acknowledgement pipeline acknowledges the alarm |
The acknowledged row exists only for occurrences that actually get acknowledged, so an alarm that clears unacknowledged keeps two rows and a fully worked alarm can write three. Confirm the mapping on your own gateway before anything downstream depends on it: open the Database Table Reference in the Ignition User Manual for your version, then pick one occurrence, for example eventid 4127, and run this against the journal database:
SELECT eventid, eventtype, eventtime
FROM alarm_events
WHERE eventid = 4127
ORDER BY eventtime;
The earliest row is the active transition. If your journal profile uses a non-default table name, run the query against the name the profile sets.
Is there a journal setting that suppresses the clear row? #
No: the alarm journal profile has no option that selects transitions by type, because every profile control acts on whole alarms — priority, shelving and age — never on the individual active or clear row.
- Priority filter: drops every transition of alarms below the threshold, active rows included. It removes whole alarms from history, not half of each one.
- Shelved-events option: decides whether shelved alarms are journaled at all. It never touches the clear rows of normal alarms.
- Age limit, also called pruning: deletes whole occurrences older than the limit, active, clear and acknowledged rows together.
- Table-name settings: change where rows land, never which rows are written.
The clear row is load-bearing. The alarm system pairs the active and clear timestamps to compute how long an alarm held each state, the Alarm Journal Table component uses the clear row to show return-to-normal, and journal queries use it to report how an occurrence ended. Strip it at the storage layer and every consumer treats every alarm as never cleared.
Can I delete the clear rows to reclaim space? #
Don't delete clear rows: the row count drops by a third to a half, but every duration calculation loses its return-to-normal timestamp and the data rows tied to the deleted events are left orphaned in alarm_event_data.
A scheduled delete or a database trigger also adds a second writer against tables the gateway owns, and it has to chase the data table too or the orphans accumulate. Use the profile's age limit instead: pruning removes whole occurrences by age, so whatever survives stays internally consistent, event rows and their property rows from the same occurrence.
Keep the full journal, clear rows included, wherever alarm records support incident review; the filtered view is a convenience for one consumer, not the record of truth.
How do I give the other software one row per alarm? #
Give the other software a filtered SQL view that keeps only eventtype = 0, grant its database login access to that view and not to the base tables, and leave the journal itself untouched.
-
Confirm the events table name in the journal profile; the default is alarm_events.
-
Create the active-only view:
CREATE VIEW alarm_active_only AS SELECT id, eventid, source, priority, eventtime FROM alarm_events WHERE eventtype = 0; -
If the consumer also needs the return-to-normal time, collapse each occurrence into one row instead of discarding the clear transition; in the second view, duration is clear_time minus active_time, and a NULL clear_time means the alarm was still active when you queried:
CREATE VIEW alarm_occurrences AS SELECT a.eventid, a.source, a.priority, a.eventtime AS active_time, MIN(c.eventtime) AS clear_time FROM alarm_events a LEFT JOIN alarm_events c ON c.eventid = a.eventid AND c.eventtype = 1 WHERE a.eventtype = 0 GROUP BY a.eventid, a.source, a.priority, a.eventtime; -
Add a composite index on eventtype and eventtime and a second index on eventid before the journal reaches production volume, so the views filter and join without scanning the whole table.
-
Grant the consumer's database login read access to the views only.
-
Point the other software at the view and remove any duplicate-handling logic on its side.
How big does the journal get, and what bounds its size? #
Size the journal by occurrences, not alarms: at 1,200 occurrences in a day the events table gains 3,480 rows, and the age limit, not the row count, is what bounds the disk.
Worked example, with example inputs you replace with your own counts. One packing line journals 400 alarm occurrences in an 8-hour shift, so across three shifts it writes 400 × 3 = 1,200 occurrences in a day. Every occurrence writes an active and a clear row, and assume 90 percent of them are also acknowledged, so the events table gains 1,200 × (1 + 1 + 0.9) = 1,200 × 2.9 = 3,480 rows in a day. The view serves only the active rows: 1,200 ÷ 3,480 ≈ 0.345, so the other software reads about 34 percent of the event rows while the journal still stores all of them. Set the profile's age limit to 90 days and the events table settles near 3,480 × 90 = 313,200 rows once the window fills. As an example figure for the data table, six property rows per transition gives 313,200 × 6 = 1,879,200 rows; count your own data table before sizing disk, because it is the one that usually grows faster.
Budget rows the same way when the journal runs on an edge box; the knowledge-base article on Ignition Edge dataset tag pruning row-count limits shows the counting method. Choosing the age limit is the same sizing exercise as for tag history, and setting historian pruning and retention for Ignition tag history walks it step by step.
The decision: the view fixes what the other software reads, the age limit fixes what the journal stores, and running both answers the original problem in full — one row per alarm downstream, bounded disk underneath.
How do I verify one row per alarm end to end? #
Toggle one alarmed Boolean tag on and off, then expect exactly two rows with the same eventid in the events table and exactly one row in the view; both row counts must match before you cut the other software over.
- Set a test Boolean tag true, wait a few seconds, set it false. Acknowledge the alarm once if you want the third row in the evidence.
- Query the events table for that source: expect two rows sharing one eventid, three with the acknowledgement.
- Query alarm_active_only for the same source: expect exactly one row.
- Query alarm_occurrences: expect one row with clear_time populated; query while the tag is still true and clear_time should be NULL.
- Compare
SELECT COUNT(*) FROM alarm_events WHERE eventtype = 0;withSELECT COUNT(*) FROM alarm_active_only;— the two counts must match. - Check the other software's own record count for the test window against the view before declaring the cut-over done.
If the counts diverge, the view or the consumer is still pointed at the wrong table; fix the target and rerun the toggle before touching the journal again.
Questions asked
Is the alarm journal stored in the same tables as Ignition tag history?
No. The alarm journal profile creates its own alarm_events and alarm_event_data tables through its own database connection, separate from the tables tag history uses. The two can live on different databases, and pruning or rebuilding the journal never touches tag history data.
What happens to shelved alarms in the journal?
The journal profile includes an option that decides whether shelved events are stored at all. Shelving acts on whole alarms, so a journaled shelved alarm still writes the same active, clear and acknowledged transitions as any other occurrence. It changes operator visibility, not the row pattern.
Can I rename the alarm_events table?
Yes. The journal profile's advanced settings define the table names Ignition creates. Keep every custom view and downstream query pointed at the names set there, and confirm the new tables exist with data arriving before you repoint any consumer.
Does the filtered view change what operators see in the Alarm Journal Table component?
No. The component reads the stored journal directly and keeps showing the active, clear and acknowledged states of each occurrence. Only software pointed at the view sees one row per alarm, so operator-facing alarm history stays exactly as it was.