1 # Trigger notification example
4 This example is made-up of three executables.
6 ### `notification-client`
9 Usage: notification-client TRIGGER_NAME TRIGGER_NAME2 ...
12 A simple client that subscribes to the notifications emitted by the `TRIGGER_NAME` trigger.
14 Multiple trigger names can be passed and subscribed to.
17 ### `instrumented-app`
19 An application that emits the `trigger_example:my_event` event every 2 seconds.
23 This script adds a trigger named `demo_trigger` which emits a notification when
24 the user-space `trigger_example:my_event` event occurs.
26 This script also adds a trigger named `demo_trigger_capture` which emits a
27 notification when the user-space `trigger_example:my_event` event occurs and
28 provides captured fields if present.
30 Once the triggers have been setup, the notification-client is launched to print
31 all notifications emitted by the `demo_trigger` and `demo_trigger_capture`
36 Simply run the included Makefile.
38 ## Running the example
40 1) Launch a session daemon using:
44 2) Launch the `demo.sh` script
45 3) Launch the `instrumented-app`
47 The following output should be produced:
51 Registering a notification trigger named "demo_trigger" for the trigger_example:my_event user-space event
52 Trigger registered successfully.
53 Subscribed to notifications of trigger "demo_trigger"
54 [02-14-2020] 18:13:34.779652 - Received notification of event rule trigger "demo_trigger_capture"
55 Captured field values:
58 [02-14-2020] 18:13:34.779766 - Received notification of event rule trigger "demo_trigger"
59 [02-14-2020] 18:13:36.779798 - Received notification of event rule trigger "demo_trigger_capture"
60 Captured field values:
63 [02-14-2020] 18:13:36.779888 - Received notification of event rule trigger "demo_trigger"
64 [02-14-2020] 18:13:38.780234 - Received notification of event rule trigger "demo_trigger_capture"
65 Captured field values:
68 [02-14-2020] 18:13:38.780514 - Received notification of event rule trigger "demo_trigger"
69 [02-14-2020] 18:13:40.780574 - Received notification of event rule trigger "demo_trigger_capture"
70 Captured field values:
73 [02-14-2020] 18:13:40.780656 - Received notification of event rule trigger "demo_trigger"
78 [02-14-2020] 18:13:34.779433 - Tracing event "trigger_example:my_event"
79 [02-14-2020] 18:13:36.779693 - Tracing event "trigger_example:my_event"
80 [02-14-2020] 18:13:38.780010 - Tracing event "trigger_example:my_event"
81 [02-14-2020] 18:13:40.780286 - Tracing event "trigger_example:my_event"