# Alarm and Event value query

**URL:** <https://forum.inductiveautomation.com/t/alarm-and-event-value-query/55755>\
**Category:** General Discussion\
**Created:** [February 4, 2022, 2:01pm UTC](https://forum.inductiveautomation.com/t/alarm-and-event-value-query/55755 "2022-02-04T14:01:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerry\_vikara](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jerry\_vikara](https://forum.inductiveautomation.com/u/jerry_vikara)\
**Post date:** [February 4, 2022, 2:01pm UTC](https://forum.inductiveautomation.com/t/alarm-and-event-value-query/55755/1 "2022-02-04T14:01:26Z")

</div>

I want to run a query from outside Ignition on the MySQL database to get the active alarms and the event value that trigger the event.  
I am able to get the Active alarms and the Timestamp by this query.  
‘SELECT \* FROM alarm\_events WHERE eventtype=2 OR eventtype=3 GROUP BY source’  
How can I modify the query to include the event value?

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [February 4, 2022, 5:41pm UTC](https://forum.inductiveautomation.com/t/alarm-and-event-value-query/55755/2 "2022-02-04T17:41:12Z")

</div>

```auto
SELECT * FROM alarm_events  
inner join alarm_event_data on alarm_events.id = alarm_event_data.id
WHERE eventtype=2 OR eventtype=3
GROUP BY source

```

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [November 21, 2023, 2:48pm UTC](https://forum.inductiveautomation.com/t/alarm-and-event-value-query/55755/3 "2023-11-21T14:48:15Z")

</div>

I got bit in the rear end by this, so I thought I'd clarify something:

If you want the active alarms, the `eventtype` is 0. NOT 2 and 3.  
You need to check that page, which describes the "alarm\_event" table:  
[https://docs.inductiveautomation.com/display/DOC81/Alarm+Journal#AlarmJournal-TableDefinitions](https://docs.inductiveautomation.com/display/DOC81/Alarm+Journal#AlarmJournal-TableDefinitions)

not this one, which describes the parameters for `system.alarm.queryJournal`:  
[https://docs.inductiveautomation.com/display/DOC81/system.alarm.queryJournal#system.alarm.queryJournal-StateValues](https://docs.inductiveautomation.com/display/DOC81/system.alarm.queryJournal#system.alarm.queryJournal-StateValues)

The states and types are NOT the same thing.
