Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertrand Rigaud committed Sep 26, 2023
1 parent 4873f10 commit 033beeb
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,13 @@ dirac-json.conf (Add all needed components and choose the output you want)::
tls.crt_file <path_to_crt_file>
tls.key_file <path_to_key_file>
match metric

``dirac-json.conf`` is the main file, it defines different steps such as::
[SERVICE] where we describe our json parser (from dirac Json log backend)
[INPUT] where we describe dirac components log file and the way it will be parsed (json)
[FILTER] where we apply modifications to parsed data, for example adding a levelname "DEV" whenever logs are not well formatted, typically "print" in code, or adding fields like hostname to know from wich host logs are coming, but also more complex treatments like in dirac.lua script (described later)
[OUTPUT] where we describe formatted logs destination, here, we have stdout, files on disks and elasticsearch.

dirac-parsers.conf::
[PARSER]
Expand All @@ -163,6 +169,8 @@ dirac-parsers.conf::
Time_Format %Y-%m-%d %H:%M:%S,%L
Time_Keep On

``dirac-parsers.conf`` describes the source format that will be parsed, and the time that will be used (here asctime field) as reference

dirac.lua::

function add_raw(tag, timestamp, record)
Expand Down Expand Up @@ -190,6 +198,8 @@ dirac.lua::
return 2, timestamp, new_record
end

``dirac.lua`` is the most important transformation we perform on primarily logs, it builds new record depending on logs containing or not special field tornadocomponent, then cleans and formats it before sending to the outputs.

Testing
-------

Expand Down

0 comments on commit 033beeb

Please sign in to comment.