How to trigger an automation based on this log event

I want to create an automation based on successful logins the Supervisor log.

2024-04-30 07:20:00.467 INFO (MainThread) [supervisor.auth] Successful login for 'myuser'

I have deduced that the trigger should be event with event type system_log_event but not sure how to write the condition logic to target successful logins with my user.

Example code I found for automations based on log events:


alias: example 555
trigger:
- platform: event
  event_type: system_log_event
condition: '{{ "zwave_js_server.exceptions.Failed" in trigger.event.data.exception }}'
action:
- service: notify.notifier_telegram
  data:
    message: 'Zwave Error 2'

It could look something like this

alias: example 555
trigger:
- platform: event
  event_type: system_log_event
  event_data:
    name: supervisor.auth
    level: INFO
condition:
  - condition: template
    value_template: "{{ 'Successful login for ''myuser''' in trigger.event.data.message }}"
action:
- service: notify.notifier_telegram
  data:
    message: 'Zwave Error 2'

Hmm, doesnt seem to trigger

Take name or level or both out of event_data. You should get too many triggers, but you will be able to see in the traces the correct values to filter on.