summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authordbiastoch <dbiastoch@de.adit-jv.com>2021-01-13 11:27:17 +0100
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2021-06-30 10:54:59 +0900
commit442688504260bb2bfcfb08a9865f223d2ab2d19a (patch)
treedeb6e007dfd727d0ec91430cac8ec9cd27e03b7e /doc
parentf5a22d09b620be0c911815145f0e6486f061aecd (diff)
downloadDLT-daemon-442688504260bb2bfcfb08a9865f223d2ab2d19a.tar.gz
dlt-receive: Enabled more filtering by using json filter files
-Added '-j' flag to dlt-receive for reading a json filter file -Added more attributes to DltFilter (LogLevel, MaxPayload, MinPayload) for extended message filtering, when using old filters these values are set to default. Same behaviour, when they are not defined in json filter file. -extended dlt_common.c to support json filter files and new DltFilter attributes +add dlt_json_filter_load to parse a json filter file into a DltFilter +add dlt_json_filter_save to print a DltFilter into a json file -Two new libraries are used to parse the json filter files: json-c for Linux based systems and the QNX internal libjson for QNX systems -gtest_dlt_common was modified to test the new function 'dlt_json_filter_load' +add testfile_extended.dlt that contains a bigger varity of messages (different context/app IDs, lengths and log levels) +add testfilter.json which is a valid json filter file -New dependency on library was added to related CMakeLists and is described in README.md Signed-off-by: dbiastoch <dbiastoch@de.adit-jv.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/dlt-receive.1.md43
-rw-r--r--doc/dlt_build_options.md1
2 files changed, 42 insertions, 2 deletions
diff --git a/doc/dlt-receive.1.md b/doc/dlt-receive.1.md
index 9d3f75e..b6184e4 100644
--- a/doc/dlt-receive.1.md
+++ b/doc/dlt-receive.1.md
@@ -6,7 +6,7 @@
# SYNOPSIS
-**dlt-receive** \[**-h**\] \[**-a**\] \[**-x**\] \[**-m**\] \[**-s**\] \[**-o** filename\] \[**-c** limit\] \[**-v**\] \[**-y**\] \[**-b** baudrate\] \[**-e** ecuid\] \[**-f** filterfile\] \[**-p** port\] hostname/serial_device_name
+**dlt-receive** \[**-h**\] \[**-a**\] \[**-x**\] \[**-m**\] \[**-s**\] \[**-o** filename\] \[**-c** limit\] \[**-v**\] \[**-y**\] \[**-b** baudrate\] \[**-e** ecuid\] \[**-f** filterfile\] \[**-j** filterfile\] \[**-p** port\] hostname/serial_device_name
# DESCRIPTION
@@ -60,7 +60,11 @@ Receive DLT messages from DLT daemon and print or store the messages.
-f
-: Enable filtering of messages.
+: Enable filtering of messages. Takes a space separated filter file (see [Space separated filter file](#Space-separated-filter-file)).
+
+-j
+
+: Enable extended filtering of messages. Takes a json filter file ([Json filter file](#Json-filter-file)).
-p
@@ -79,6 +83,41 @@ Store received message headers from a dlt-daemon to a log file called log.dlt an
Store incoming messages in file(s) and restrict file sizes to 1 megabyte. If limit is reached, log.dlt will be renamed into log.0.dlt, log.1.dlt, ... No files will be overwritten in this mode::
**dlt-receive -o log.dlt -c 1M localhost**
+## Space separated filter file
+File that defines multiple filters. Can be used as argument for `-f` option. With this it's only possible to filter messages depending on their Application ID and/or Context ID. The syntax is: first AppID and optional a CtxID behind it, with a space in between. Each line defines a filter and the maximum number of filters is 30.
+
+Example:
+```
+DLTD INTM
+DLT INT
+TEST
+```
+
+## Json filter file
+Only available, when builded with cmake option `WITH_EXTENDED_FILTERING`.
+
+File that defines multiple filters. Can be used as argument for `-j` option. With this it's also possible to filter messages depending on their Application ID, Context ID, log level and payload size. The following example shows the syntax. Names of the filters can be customized, but not more than 15 characters long. The maximum number of filters is also 30.
+
+Example:
+```
+{
+"filter1": {
+ "AppId": "LOG",
+ "ContextId": "TEST",
+ "LogLevel": "3"
+ },
+"filter2": {
+ "AppId": "app",
+ "LogLevel": "4"
+ },
+"filter3": {
+ "AppId": "app2",
+ "ContextId": "con2",
+ "PayloadMin": "20",
+ "PayloadMax": "50"
+ }
+}
+```
# EXIT STATUS
Non zero is returned in case of failure.
diff --git a/doc/dlt_build_options.md b/doc/dlt_build_options.md
index 9a91193..1a7dad6 100644
--- a/doc/dlt_build_options.md
+++ b/doc/dlt_build_options.md
@@ -39,6 +39,7 @@ WITH\_DLT\_CONSOLE | ON | Set to ON to build src/cons
WITH\_DLT\_SYSTEM | OFF | Set to ON to build src/system binaries
WITH\_DLT\_LOGSTORAGE\_CTRL\_UDEV | OFF | PROTOTYPE! Set to ON to build
WITH\_DLT\_KPI | OFF | Set to ON to build src/kpi binaries
+WITH\_EXTENDED\_FILTERING | OFF | Set to OFF to build without extended filtering. Using json filter files is only supported for Linux based system with json-c and QNX.
## Linux OS Integration Options