Demos¶
Elos comes with a set of demo applications to show certain aspects of elos.
elosMon – publish events as mails¶
==23942==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
elosc – simple commandline client¶
==23943==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To verify the elos version use :
$ elosc -v
==23944==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To subscribe on any event :
$ elosc -s "1 1 EQ"
==23945==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To subscribe on coredump events :
$ elosc -s ".event.messageCode 5005 EQ"
==23946==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To list all events logged :
$ elosc -f "1 1 EQ"
==23947==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To list all logged events that are critical :
$ elosc -f "event.severity 1 EQ"
==23948==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To publish an event :
$ elosc -p '{"messageCode": 1001, "severity": 4, "payload": "a custom event with severity INFO (4)"}'
==23949==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To publish 100 events as fast as possible :
$ elosc -c 100 -p '{"messageCode": 1001, "severity": 4, "payload": "publish 100 events as fast as possible"}'
==23950==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To publish 100 events with 50Hz :
$ elosc -c 100 -r 50 -p '{"messageCode": 1001, "severity": 4, "payload": "publish 100 events at 50Hz"}'
==23951==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To set host ip :
$ elosc -H 127.0.0.1 -f "1 1 Q"
==23952==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To set host connection port :
$ elosc -H 127.0.0.10 -P 9876 -f "1 1 Q"
==23953==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
demo_libelos_v2 – publish subscrie demo using libelos¶
To verify the elos version use :
$ demo_libelos_v2 -v
==23954==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
demo_libeloslite¶
This demo is a simple demonstration of libelos-lite. It Connects to elosd, publishes a simple event than publishes a very long event than a simple event again and finally disconnects from elosd again.
demo_eventbuffer – test performance of event buffer¶
This demo was manly developed to test and verify the EventBuffer component.
==23959==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To benchmark the event buffers on a target with default value run:
$ demo_eventbuffer
==23960==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To benchmark the event buffers on a target to find optimal configuration :
$ demo_eventbuffer --publisher 100 --consumer 10 --messageCount 1000 --eventLimit 300
==23961==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
syslog_example – demonstrate and test the syslog scanner¶
With the syslog_example demo it is possible to verify if the syslog scanner is configured correctly. It can also be used to develop the mapping rules for the syslog scanner.
To verify that the syslog scanner is working:
$ syslog_example "Syslog scanner test"; elosc -f ".event.payload 'Syslog scanner test' STRCMP"
==23962==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
Simulate syslog lines and test a filter if it can be used as mapping rule for the syslog-scanner:
$ syslog_example "Jun 15 19:56:23 hostnameXY wpa_supplicant[420]: wlp0s20f3: WPA: Group rekeying completed with 00:00:00:00:00:00 [GTK=TKIP]"
==23963==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
$ elosc -f ".event.payload r'WPA: Group rekeying' REGEX"
==23964==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
tinyElosc – minimized elos client to send raw payload¶
This demo was developed to send raw formatted payload. The payload is not preprocessed and validated by any JSON parser. This can be used to send malformed or any arbitrary encoded payload.
==23965==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
To verify the elos version use :
$ tinyElosc -v
==23966==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
Test elos for arbitrary not valid encoded payload:
$ tinyElosc -p "<wrong>this is not a JSON string</wrong>"
==23967==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
elos_log4c_demo - a demo program to show log4c logging in elos¶
This demo was developed to demonstrate the usage of log4c logging framework with elos. The configuration for log4c can be set with the help of a log4crc configuration file.
In order to log with a log4c framework, a category, a priority and an appender for the logged message should be set in the config file.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE log4c SYSTEM "">
<log4c version="1.2.4">
<config>
<bufsize>0</bufsize>
<debug level="2"/>
<nocleanup>0</nocleanup>
<reread>1</reread>
</config>
<category name="root" priority="notice"/>
<appender name="stdout" type="stream" layout="dated"/>
<appender name="stderr" type="stream" layout="dated"/>
<appender name="syslog" type="syslog" layout="basic"/>
<appender name="elos" type="elos_appender" layout="elos_layout"/>
<layout name="basic" type="basic"/>
<layout name="dated" type="dated"/>
<layout name="elos_layout" type="elos_formatter"/>
<category name="log4c.elos.demo.log4cdemo" priority="debug" appender="elos" />
</log4c>
More information about how to use log4c framework can be found here : https://log4c.sourceforge.net/
For the elos_log4c_demo application a separate category log4c.elos.demo.log4cdemo
with an appender elos
is created in the config file log4crc
as shown above. The category is the log message destination. The appender outputs the log message to the specified output. An example of an log4c appender can be found here : https://sourceforge.net/p/log4c/log4c/ci/master/tree/examples/example_appenders.c. The output can be an output stream, file, syslog etc. The elos_appender
has a layout elos_layout
which formats the log message using the formatter elos_formatter
. An example ofa log4c formatter can be found here : https://sourceforge.net/p/log4c/log4c/ci/master/tree/examples/example_formatters.c. The elos_formatter
formats the log message using pattern strings and sends the formatted string back to the appender to be released out.
$ elos_log4c_demo
==23968==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
elosDlt - a demo program to show useage of libelosdlt¶
Elos provides a basic implementation of the DLT protocol to publish elos events to a DLT daemon. To observer the workings of libelosdlt and DLT, a dlt-daemon is required to be installed and running. Information about dlt-daemon installation and setup can be found here: https://github.com/COVESA/dlt-daemon.
$ elosDlt
==23969==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.