diff --git a/_includes/head.html b/_includes/head.html index b238cd33..b2bc64cc 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -13,6 +13,7 @@ {% include globals.html %} {% include skins.html %} + diff --git a/_plugins/log.rb b/_plugins/log.rb new file mode 100644 index 00000000..d06d2352 --- /dev/null +++ b/_plugins/log.rb @@ -0,0 +1,25 @@ +require "cgi" + +# Liquid block to render log excerpts +# +# {% log %} +# New lines are preserved. +# Long lines will be wrapped when displayed on screen. +# {% endlog %} +# +# Will be rendered in the browser to: +# +# |<--------- screen size --------->| +# | New lines are preserved. | +# | Long lines will be wrapped when | +# | displayed on screen. | +class LogBlock < Liquid::Block + def render(context) + output = '
' + output << CGI.escapeHTML(super.strip).gsub(/\n[[:blank:]]*/, "" + output + end +end + +Liquid::Template.register_tag("log", LogBlock) diff --git a/assets/css/log.scss b/assets/css/log.scss new file mode 100644 index 00000000..2e123416 --- /dev/null +++ b/assets/css/log.scss @@ -0,0 +1,12 @@ +--- +search: false +toc: false +--- + +@import "minimal-mistakes/variables"; + +blockquote.log { + text-indent: 2em hanging each-line; + font-family: $monospace; + white-space: pre-wrap; +} diff --git a/doc/_admin-guide/020_The_concepts_of_syslog-ng/007_The_structure_of_a_log_message/002_EWMM_messages.md b/doc/_admin-guide/020_The_concepts_of_syslog-ng/007_The_structure_of_a_log_message/002_EWMM_messages.md index eb8ecec4..6c1cc15c 100644 --- a/doc/_admin-guide/020_The_concepts_of_syslog-ng/007_The_structure_of_a_log_message/002_EWMM_messages.md +++ b/doc/_admin-guide/020_The_concepts_of_syslog-ng/007_The_structure_of_a_log_message/002_EWMM_messages.md @@ -21,9 +21,9 @@ on the receiver side. The following is a sample log message in EWMM format. -><13>1 2018-05-13T13:27:50.993+00:00 my-host @syslog-ng - - - ->{"MESSAGE":"<34>Oct 11 22:14:15 mymachine su: 'su root' failed for username on ->/dev/pts/8","HOST_FROM":"my-host","HOST":"my-host","FILE_NAME":"/tmp/in","._TAGS":".source.s_file"} +{% log %} +<13>1 2018-05-13T13:27:50.993+00:00 my-host @syslog-ng - - - {"MESSAGE":"<34>Oct 11 22:14:15 mymachine su: 'su root' failed for username on /dev/pts/8","HOST_FROM":"my-host","HOST":"my-host","FILE_NAME":"/tmp/in","._TAGS":".source.s_file"} +{% endlog %} The message has the following parts: diff --git a/doc/_admin-guide/040_Quick-start_guide/003_Managing_and_checking_syslog-ng_OSE_service_on_Linux.md b/doc/_admin-guide/040_Quick-start_guide/003_Managing_and_checking_syslog-ng_OSE_service_on_Linux.md index 6a9380dd..76de52bb 100644 --- a/doc/_admin-guide/040_Quick-start_guide/003_Managing_and_checking_syslog-ng_OSE_service_on_Linux.md +++ b/doc/_admin-guide/040_Quick-start_guide/003_Managing_and_checking_syslog-ng_OSE_service_on_Linux.md @@ -71,29 +71,33 @@ To check the status of {{ site.product.short_name }} service - **active (running)** - {{ site.product.short_name }} service is up and running - Example: {{ site.product.short_name }} service active - - > syslog-ng.service - System Logger Daemon - > Loaded: loaded (/lib/systemd/system/syslog-ng.service; enabled; vendor preset: enabled) - > Active: active (running) since Tue 2019-06-25 08:58:09 CEST; 5s ago - > Main PID: 6575 (syslog-ng) - > Tasks: 3 - > Memory: 13.3M - > CPU: 268ms - > CGroup: /system.slice/syslog-ng.service - > 6575 /opt/syslog-ng/libexec/syslog-ng -F --no-caps --enable-core + Example: {{ site.product.short_name }} service active + + {% log %} + syslog-ng.service - System Logger Daemon + Loaded: loaded (/lib/systemd/system/syslog-ng.service; enabled; vendor preset: enabled) + Active: active (running) since Tue 2019-06-25 08:58:09 CEST; 5s ago + Main PID: 6575 (syslog-ng) + Tasks: 3 + Memory: 13.3M + CPU: 268ms + CGroup: /system.slice/syslog-ng.service + 6575 /opt/syslog-ng/libexec/syslog-ng -F --no-caps --enable-core + {% endlog %} - **inactive (dead)** - syslog-ng service is stopped Example: {{ site.product.short_name }} status inactive - > syslog-ng.service - System Logger Daemon - > Loaded: loaded (/lib/systemd/system/syslog-ng.service; enabled; vendor preset: enabled) - > Active: inactive (dead) since Tue 2019-06-25 09:14:16 CEST; 2min 18s ago - > Process: 6575 ExecStart=/opt/syslog-ng/sbin/syslog-ng -F --no-caps --enable-core $SYSLOGNG_OPTIONS(code=exited, status=0/SUCCESS) - > Main PID: 6575 (code=exited, status=0/SUCCESS) - > Status: "Shutting down... Tue Jun 25 09:14:16 2019" - > Jun 25 09:14:31 as-syslog-srv systemd: Stopped System Logger Daemon. + {% log %} + syslog-ng.service - System Logger Daemon + Loaded: loaded (/lib/systemd/system/syslog-ng.service; enabled; vendor preset: enabled) + Active: inactive (dead) since Tue 2019-06-25 09:14:16 CEST; 2min 18s ago + Process: 6575 ExecStart=/opt/syslog-ng/sbin/syslog-ng -F --no-caps --enable-core $SYSLOGNG_OPTIONS(code=exited, status=0/SUCCESS) + Main PID: 6575 (code=exited, status=0/SUCCESS) + Status: "Shutting down... Tue Jun 25 09:14:16 2019" + Jun 25 09:14:31 as-syslog-srv systemd: Stopped System Logger Daemon. + {% endlog %} ### Checking the process of {{ site.product.short_name }} @@ -105,10 +109,10 @@ ps u `pidof syslog-ng` Expected output example: -> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND -> -> syslogng 6709 0.0 0.6 308680 13432 ? Ss 09:17 0:00 -> /opt/syslog-ng/libexec/syslog-ng -F --no-caps --enable-core +{% log %} +USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND +syslogng 6709 0.0 0.6 308680 13432 ? Ss 09:17 0:00 /opt/syslog-ng/libexec/syslog-ng -F --no-caps --enable-core +{% endlog %} ```bash ps axu | grep syslog-ng | grep -v grep @@ -116,8 +120,9 @@ ps axu | grep syslog-ng | grep -v grep Expected output example: -> syslogng 6709 0.0 0.6 308680 13432 ? Ss 09:17 0:00 -> /opt/syslog-ng/libexec/syslog-ng -F --no-caps --enable-core +{% log %} +syslogng 6709 0.0 0.6 308680 13432 ? Ss 09:17 0:00 /opt/syslog-ng/libexec/syslog-ng -F --no-caps --enable-core +{% endlog %} ### Checking the internal logs of {{ site.product.short_name }}** @@ -154,10 +159,11 @@ If the numbers are changing, {{ site.product.short_name }} is processing the mes Example: output example -> Every 2.0s: /opt/syslog-ng/sbin/syslog-ng-ctl stats | grep -> ^center Tue Jun 25 10:33:25 2019 -> center;;queued;a;processed;112 -> center;;received;a;processed;28 +{% log %} +Every 2.0s: /opt/syslog-ng/sbin/syslog-ng-ctl stats | grep ^center Tue Jun 25 10:33:25 2019 +center;;queued;a;processed;112 +center;;received;a;processed;28 +{% endlog %} ### Source statistics @@ -173,11 +179,12 @@ If the numbers are changing, {{ site.product.short_name }} is receiving messages Example: output example -> Every 2.0s: /opt/syslog-ng/sbin/syslog-ng-ctl stats | grep -> ^source Tue Jun 25 10:40:50 2019 -> source;s_null;;a;processed;0 -> source;s_net;;a;processed;0 -> source;s_local;;a;processed;90 +{% log %} +Every 2.0s: /opt/syslog-ng/sbin/syslog-ng-ctl stats | grep ^source Tue Jun 25 10:40:50 2019 +source;s_null;;a;processed;0 +source;s_net;;a;processed;0 +source;s_local;;a;processed;90 +{% endlog %} ### Destination statistics @@ -193,12 +200,13 @@ If the numbers are changing, {{ site.product.short_name }} is receiving messages Example: output example -> Every 2.0s: /opt/syslog-ng/sbin/syslog-ng-ctl stats | grep -> ^destination Tue Jun 25 10:41:02 2019 -> destination;d_logserver2;;a;processed;90 -> destination;d_messages;;a;processed;180 -> destination;d_logserver;;a;processed;90 -> destination;d_null;;a;processed;0 +{% log %} +Every 2.0s: /opt/syslog-ng/sbin/syslog-ng-ctl stats | grep ^destination Tue Jun 25 10:41:02 2019 +destination;d_logserver2;;a;processed;90 +destination;d_messages;;a;processed;180 +destination;d_logserver;;a;processed;90 +destination;d_null;;a;processed;0 +{% endlog %} **NOTE:** If you find error messages in the internal logs, messages are not processed by {{ site.product.short_name }} or you encounter any issue, you have the diff --git a/doc/_admin-guide/060_Sources/070_Network/001_Proxy_protocol_support/000_Proxy_protocol_working_mechanism.md b/doc/_admin-guide/060_Sources/070_Network/001_Proxy_protocol_support/000_Proxy_protocol_working_mechanism.md index 7d11c585..1cd02fd5 100644 --- a/doc/_admin-guide/060_Sources/070_Network/001_Proxy_protocol_support/000_Proxy_protocol_working_mechanism.md +++ b/doc/_admin-guide/060_Sources/070_Network/001_Proxy_protocol_support/000_Proxy_protocol_working_mechanism.md @@ -21,18 +21,19 @@ macros to every message the comes through the connection later on: - PROXY_DSTPORT (the destination port of the proxy) ->**NOTE:** Consider the following about macros and headers: -> +>**NOTE:** Consider the following about macros and headers: +> >- When the proxy protocol header is PROXY UNKNOWN, no additional macros are added. -> +> >- When {{ site.product.short_name }} cannot parse a proxy protocol header, the connection is closed: -> -> [2020-11-20T17:33:22.189458] PROXY protocol header received; line='PROXYdsfj' -> [2020-11-20T17:33:22.189475] Error parsing PROXY protocol header; -> [2020-11-20T17:33:22.189517] Syslog connection closed; fd='13', -> client='AF_INET(127.0.0.1:51665)', local='AF_INET(0.0.0.0:6666)' -> [2020-11-20T17:33:22.189546] Freeing PROXY protocol source driver; driver='0x7fffcba5bcf0' +> +> {% log %} +> [2020-11-20T17:33:22.189458] PROXY protocol header received; line='PROXYdsfj' +> [2020-11-20T17:33:22.189475] Error parsing PROXY protocol header; +> [2020-11-20T17:33:22.189517] Syslog connection closed; fd='13', client='AF_INET(127.0.0.1:51665)', local='AF_INET(0.0.0.0:6666)' +> [2020-11-20T17:33:22.189546] Freeing PROXY protocol source driver; driver='0x7fffcba5bcf0' > [2020-11-20T17:33:22.189600] Closing log transport fd; fd='13' +> {% endlog %} {: .notice--info} **NOTE:** Since the driver only implements version 1 of the protocol, it diff --git a/doc/_admin-guide/060_Sources/070_Network/001_Proxy_protocol_support/001_Proxy_protocol_configuration.md b/doc/_admin-guide/060_Sources/070_Network/001_Proxy_protocol_support/001_Proxy_protocol_configuration.md index fe582c70..6fdd3bd8 100644 --- a/doc/_admin-guide/060_Sources/070_Network/001_Proxy_protocol_support/001_Proxy_protocol_configuration.md +++ b/doc/_admin-guide/060_Sources/070_Network/001_Proxy_protocol_support/001_Proxy_protocol_configuration.md @@ -76,9 +76,8 @@ the output. With the PROXY TCP4 192.168.1.1 10.10.0.1 1111 2222 input header, the output looks like this: -> {"SOURCE":"s_tcp_pp","PROXIED_SRCPORT":"1111","PROXIED_SRCIP":"192.168.1.1", ->"PROXIED_IP_VERSION":"4","PROXIED_DSTPORT":"2222","PROXIED_DSTIP":"10.10.0.1", ->"PROGRAM":"TestMsg","MESSAGE":"","LEGACY_MSGHDR":"TestMsg", ->"HOST_FROM":"localhost","HOST":"localhost"} +{% log %} +{"SOURCE":"s_tcp_pp","PROXIED_SRCPORT":"1111","PROXIED_SRCIP":"192.168.1.1", "PROXIED_IP_VERSION":"4","PROXIED_DSTPORT":"2222","PROXIED_DSTIP":"10.10.0.1", "PROGRAM":"TestMsg","MESSAGE":"","LEGACY_MSGHDR":"TestMsg", "HOST_FROM":"localhost","HOST":"localhost"} +{% endlog %} Note that the macros that {{ site.product.short_name }} adds to the message appear in the output. diff --git a/doc/_admin-guide/060_Sources/102_osquery/README.md b/doc/_admin-guide/060_Sources/102_osquery/README.md index 0fc398e8..1ddcb5ae 100644 --- a/doc/_admin-guide/060_Sources/102_osquery/README.md +++ b/doc/_admin-guide/060_Sources/102_osquery/README.md @@ -14,7 +14,7 @@ The osquery() source of {{ site.product.short_name }} allows you read the result periodical osquery queries (from the /var/log/osquery/osqueryd.results.log file) and automatically parse the messages (if you want to use {{ site.product.short_name }} to send log messages to -osquery, read this blogpost). +osquery, read this blogpost). For example, you can: @@ -100,16 +100,9 @@ the outgoing message will be a well-formed JSON message. #### Input message ->{"name":"pack_osquery-monitoring_osquery_info","hostIdentifier":"testhost", ->"calendarTime":"Fri Jul 21 10:04:41 2017 >UTC","unixTime":"1500631481", ->"decorations":{"host_uuid":"4C4C4544-004D-3610-8043-C2C04F4D3332", ->"username":"myuser"},>"columns":{"build_distro":"xenial", ->"build_platform":"ubuntu",>"config_hash":"43cd1c6a7d0c283e21e026a53e619b2e582e94ee", ->"config_valid":"1","counter":"4","extensions":"active", ->"instance_id":"d0c3eb0d-f8e0-4bea-868b-18a2c61b438d","pid":"19764", ->"resident_size":"26416000",>"start_time":"1500629552","system_time":"223", ->"user_time":"476","uuid":"4C4C4544-004D-3610-8043-C2C04F4D3332", ->"version":"2.5.0","watcher":"19762"},"action":"added"} +{% log %} +{"name":"pack_osquery-monitoring_osquery_info","hostIdentifier":"testhost", "calendarTime":"Fri Jul 21 10:04:41 2017 >UTC","unixTime":"1500631481", "decorations":{"host_uuid":"4C4C4544-004D-3610-8043-C2C04F4D3332", "username":"myuser"},>"columns":{"build_distro":"xenial", "build_platform":"ubuntu",>"config_hash":"43cd1c6a7d0c283e21e026a53e619b2e582e94ee", "config_valid":"1","counter":"4","extensions":"active", "instance_id":"d0c3eb0d-f8e0-4bea-868b-18a2c61b438d","pid":"19764", "resident_size":"26416000",>"start_time":"1500629552","system_time":"223", "user_time":"476","uuid":"4C4C4544-004D-3610-8043-C2C04F4D3332", "version":"2.5.0","watcher":"19762"},"action":"added"} +{% endlog %} #### {{ site.product.short_name }} configuration @@ -138,16 +131,8 @@ log { #### Outgoing message ->Outgoing message; message='{"_osquery":{"unixTime":"1500631481", ->"name":"pack_osquery-monitoring_osquery_info","hostIdentifier":"testhost", ->"decorations":{"username":"myuser","host_uuid":"4C4C4544-004D-3610-8043-C2C04F4D3332"}, ->"columns":{"watcher":"19762","version":"2.5.0","uuid":"4C4C4544-004D-3610-8043-C2C04F4D3332", ->"user_time":"476","system_time":"223","start_time":"1500629552", ->"resident_size":"26416000","pid":"19764","instance_id":"d0c3eb0d-f8e0-4bea-868b-18a2c61b438d", ->"extensions":"active","counter":"4","config_valid":"1", ->"config_hash":"43cd1c6a7d0c283e21e026a53e619b2e582e94ee","build_platform":"ubuntu", ->"build_distro":"xenial"},"calendarTime":"Fri Jul 21 10:04:41 2017 UTC","action":"added"}}\x0a' +> Outgoing message; message='{"_osquery":{"unixTime":"1500631481", "name":"pack_osquery-monitoring_osquery_info","hostIdentifier":"testhost", "decorations":{"username":"myuser","host_uuid":"4C4C4544-004D-3610-8043-C2C04F4D3332"}, "columns":{"watcher":"19762","version":"2.5.0","uuid":"4C4C4544-004D-3610-8043-C2C04F4D3332", "user_time":"476","system_time":"223","start_time":"1500629552", "resident_size":"26416000","pid":"19764","instance_id":"d0c3eb0d-f8e0-4bea-868b-18a2c61b438d", "extensions":"active","counter":"4","config_valid":"1", "config_hash":"43cd1c6a7d0c283e21e026a53e619b2e582e94ee","build_platform":"ubuntu", "build_distro":"xenial"},"calendarTime":"Fri Jul 21 10:04:41 2017 UTC","action":"added"}}\x0a' To configure a destination to send the log messages to Elasticsearch, -see elasticsearch-http: Sending messages to Elasticsearch HTTP Bulk API. +see elasticsearch-http: Sending messages to Elasticsearch HTTP Bulk API. For other destinations, see destination: Forward, send, and store log messages. diff --git a/doc/_admin-guide/060_Sources/140_Python/001_Python_logmessage_API.md b/doc/_admin-guide/060_Sources/140_Python/001_Python_logmessage_API.md index 2ac20f9f..eaa538a4 100644 --- a/doc/_admin-guide/060_Sources/140_Python/001_Python_logmessage_API.md +++ b/doc/_admin-guide/060_Sources/140_Python/001_Python_logmessage_API.md @@ -64,11 +64,13 @@ set in the message, and uses the IP address of the {{ site.product.short_name }} the hostname (to use the hostname instead of the IP address, set the use-dns() or use-fqdn() options in the Python source). ->msg_ietf = LogMessage.parse('<165>1 2003-10-11T22:14:15.003Z mymachine.example.com ->evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"] ->An application event log entry', self.parse_options) ->msg_bsd = LogMessage.parse('<34>Oct 11 22:14:15 mymachine su: \'su root\' failed for ->lonvick on /dev/pts/8', self.parse_options) +```python +msg_ietf = LogMessage.parse('<165>1 2003-10-11T22:14:15.003Z mymachine.example.com \ +evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"] \ +An application event log entry', self.parse_options) +msg_bsd = LogMessage.parse('<34>Oct 11 22:14:15 mymachine su: \'su root\' failed for \ +lonvick on /dev/pts/8', self.parse_options) +``` ## set_pri() method diff --git a/doc/_admin-guide/060_Sources/155_stdin/README.md b/doc/_admin-guide/060_Sources/155_stdin/README.md index b7c7ff12..20c86921 100644 --- a/doc/_admin-guide/060_Sources/155_stdin/README.md +++ b/doc/_admin-guide/060_Sources/155_stdin/README.md @@ -35,6 +35,8 @@ used to collect a test message: $ echo "this is a test message" | ./syslog-ng -Fe --no-caps ``` -> [2017-11-14T13:47:16.757938] syslog-ng starting up; version='3.12.1' -> [2017-11-14T13:47:16.758195] syslog-ng shutting down; version='3.12.1' -> Nov 14 13:47:16 testserver this is a test message +{% log %} +[2017-11-14T13:47:16.757938] syslog-ng starting up; version='3.12.1' +[2017-11-14T13:47:16.758195] syslog-ng shutting down; version='3.12.1' +Nov 14 13:47:16 testserver this is a test message +{% endlog %} diff --git a/doc/_admin-guide/070_Destinations/310_syslog-ng/README.md b/doc/_admin-guide/070_Destinations/310_syslog-ng/README.md index 2d7f7ebb..70642137 100644 --- a/doc/_admin-guide/070_Destinations/310_syslog-ng/README.md +++ b/doc/_admin-guide/070_Destinations/310_syslog-ng/README.md @@ -28,9 +28,9 @@ to properly handle the messages. The following is a sample log message in EWMM format. -> <13>1 2018-05-13T13:27:50.993+00:00 my-host @syslog-ng - - - -> {"MESSAGE":"<34>Oct 11 22:14:15 mymachine su: 'su root' failed for username on -> /dev/pts/8","HOST_FROM":"my-host","HOST":"my-host","FILE_NAME":"/tmp/in","._TAGS":".source.s_file"} +{% log %} +<13>1 2018-05-13T13:27:50.993+00:00 my-host @syslog-ng - - - {"MESSAGE":"<34>Oct 11 22:14:15 mymachine su: 'su root' failed for username on /dev/pts/8","HOST_FROM":"my-host","HOST":"my-host","FILE_NAME":"/tmp/in","._TAGS":".source.s_file"} +{% endlog %} **Declaration** diff --git a/doc/_admin-guide/080_Log/020_Buffering/003_How_to_get_information/002_List.md b/doc/_admin-guide/080_Log/020_Buffering/003_How_to_get_information/002_List.md index e8bc2abe..02911fbf 100644 --- a/doc/_admin-guide/080_Log/020_Buffering/003_How_to_get_information/002_List.md +++ b/doc/_admin-guide/080_Log/020_Buffering/003_How_to_get_information/002_List.md @@ -20,10 +20,14 @@ The following command will list the disk-buffer files in use: The example output will look like the following: -> afsocket_dd_qfile(stream,10.21.10.20:601) ==> /opt/syslog-ng/var/syslog-ng-00000.rqf - -**NOTE:** If you receive the following error message instead of the example -output, install a vim-common package on your system: -{: .notice--info} +{% log %} + afsocket_dd_qfile(stream,10.21.10.20:601) ==> /opt/syslog-ng/var/syslog-ng-00000.rqf +{% endlog %} +> **NOTE:** If you receive the following error message instead of the example +> output, install a vim-common package on your system: +> +> {% log %} > xxd: command not found +> {% endlog %} +{: .notice--info} diff --git a/doc/_admin-guide/080_Log/020_Buffering/003_How_to_get_information/003_Content.md b/doc/_admin-guide/080_Log/020_Buffering/003_How_to_get_information/003_Content.md index 407e27c3..fd6a5e31 100644 --- a/doc/_admin-guide/080_Log/020_Buffering/003_How_to_get_information/003_Content.md +++ b/doc/_admin-guide/080_Log/020_Buffering/003_How_to_get_information/003_Content.md @@ -24,9 +24,11 @@ disk-buffer files used in {{ site.product.short_name }}: dqtool cat /opt/syslog-ng/var/syslog-ng-00000.rqf ``` ->Reliable disk-buffer state loaded; filename='/opt/syslog-ng/var/syslog-ng-00000.rqf', ->queue_length='2952', size='-437712' ->Jul 31 12:33:48.226 10.21.10.10 <382019-07-31T12:33:36 localhost prg00000[1234]: ->seq: 0000000838, thread: 0000, runid: 1564569216, stamp: 2019-07-31T12:33:36 ->PADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADD ->... +{% log %} +Reliable disk-buffer state loaded; filename='/opt/syslog-ng/var/syslog-ng-00000.rqf', +queue_length='2952', size='-437712' +Jul 31 12:33:48.226 10.21.10.10 <382019-07-31T12:33:36 localhost prg00000[1234]: +seq: 0000000838, thread: 0000, runid: 1564569216, stamp: 2019-07-31T12:33:36 +PADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADD +... +{% endlog %} diff --git a/doc/_admin-guide/080_Log/020_Buffering/003_How_to_get_information/005_How_to_process_orphan_diskbuffer.md b/doc/_admin-guide/080_Log/020_Buffering/003_How_to_get_information/005_How_to_process_orphan_diskbuffer.md index cd104ac9..52d321f4 100644 --- a/doc/_admin-guide/080_Log/020_Buffering/003_How_to_get_information/005_How_to_process_orphan_diskbuffer.md +++ b/doc/_admin-guide/080_Log/020_Buffering/003_How_to_get_information/005_How_to_process_orphan_diskbuffer.md @@ -156,12 +156,14 @@ To process the messages from an orphan disk-buffer file using a separate Example: output displaying newly created empty disk-buffer file and connection established to remote destination - >Follow-mode file source not found, deferring open; filename='/no_such_file_or.dir' - >Reliable disk-buffer state saved; filename='/tmp/qdisk/syslog-ng-00000.rqf', qdisk_length='0' - >No server license found, running in client mode; - >syslog-ng starting up; version='7.0.20', cfg-fingerprint='eaa03b9efb88b87d7c1b0ce7efd042ed8ac0c013', >cfg-nonce-ndx='0', cfg-signature='c0327a7f7e6418ce0399a75089377dfb662bb072' - >FIPS information; FIPS-mode='disabled' - >Syslog connection established; fd='7', server='AF_INET(10.21.10.20:514)', local='AF_INET(0.0.0.0:0)' + {% log %} + Follow-mode file source not found, deferring open; filename='/no_such_file_or.dir' + Reliable disk-buffer state saved; filename='/tmp/qdisk/syslog-ng-00000.rqf', qdisk_length='0' + No server license found, running in client mode; + syslog-ng starting up; version='7.0.20', cfg-fingerprint='eaa03b9efb88b87d7c1b0ce7efd042ed8ac0c013', >cfg-nonce-ndx='0', cfg-signature='c0327a7f7e6418ce0399a75089377dfb662bb072' + FIPS information; FIPS-mode='disabled' + Syslog connection established; fd='7', server='AF_INET(10.21.10.20:514)', local='AF_INET(0.0.0.0:0)' + {% endlog %} 7. To stop {{ site.product.short_name }}, press CTRL+C. diff --git a/doc/_admin-guide/100_TLS-encrypted_message_transfer/003_Password_protected_keys.md b/doc/_admin-guide/100_TLS-encrypted_message_transfer/003_Password_protected_keys.md index ff6357ad..41883bba 100644 --- a/doc/_admin-guide/100_TLS-encrypted_message_transfer/003_Password_protected_keys.md +++ b/doc/_admin-guide/100_TLS-encrypted_message_transfer/003_Password_protected_keys.md @@ -45,8 +45,10 @@ their status. For example: syslog-ng-ctl credentials status ``` ->Secret store status: ->/home/user/ssl_test/client-1/client-encrypted.key SUCCESS +{% log %} +Secret store status: +/home/user/ssl_test/client-1/client-encrypted.key SUCCESS +{% endlog %} If the status of a key is PENDING, you must provide the passphrase for the key, otherwise {{ site.product.short_name }} cannot use it. The sources and @@ -57,7 +59,9 @@ keys every time {{ site.product.short_name }} is restarted. The following log message also notifies you of PENDING passphrases: ->Waiting for password; keyfile='private.key' +{% log %} +Waiting for password; keyfile='private.key' +{% endlog %} You can add the passphrase to a password-protected private key file using the following command. {{ site.product.short_name }} will display a prompt for you diff --git a/doc/_admin-guide/110_Template_and_rewrite/000_Customize_message_format/007_Template_functions_of_syslog-ng.md b/doc/_admin-guide/110_Template_and_rewrite/000_Customize_message_format/007_Template_functions_of_syslog-ng.md index ff33f9c6..7e879f9d 100644 --- a/doc/_admin-guide/110_Template_and_rewrite/000_Customize_message_format/007_Template_functions_of_syslog-ng.md +++ b/doc/_admin-guide/110_Template_and_rewrite/000_Customize_message_format/007_Template_functions_of_syslog-ng.md @@ -201,9 +201,9 @@ format. Available in version 3.16 and later. The following is a sample log message in EWMM format. -><13>1 2018-05-13T13:27:50.993+00:00 my-host @syslog-ng - - - ->{"MESSAGE":"<34>Oct 11 22:14:15 mymachine su: 'su root' failed for username on ->/dev/pts/8","HOST_FROM":"my-host","HOST":"my-host","FILE_NAME":"/tmp/in","._TAGS":".source.s_file"} +{% log %} +<13>1 2018-05-13T13:27:50.993+00:00 my-host @syslog-ng - - - {"MESSAGE":"<34>Oct 11 22:14:15 mymachine su: 'su root' failed for username on /dev/pts/8","HOST_FROM":"my-host","HOST":"my-host","FILE_NAME":"/tmp/in","._TAGS":".source.s_file"} +{% endlog %} ## $(format-flat-json) diff --git a/doc/_admin-guide/120_Parser/001_Apache_access_log_parser/README.md b/doc/_admin-guide/120_Parser/001_Apache_access_log_parser/README.md index 6cf23171..da16c871 100644 --- a/doc/_admin-guide/120_Parser/001_Apache_access_log_parser/README.md +++ b/doc/_admin-guide/120_Parser/001_Apache_access_log_parser/README.md @@ -13,13 +13,16 @@ description: >- The following is a sample log message: ->127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 +{% log %} +127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 +{% endlog %} Starting with version 3.21, virtualhost and the port of the virtualhost (vhost) is also supported, for example: ->foo.com:443 1.2.3.4 - - [15/Apr/2019:14:30:16 -0400] "GET /bar.html HTTP/2.0" ->500 - "https://foo.com/referer.html" "Mozilla/5.0 ..." +{% log %} +foo.com:443 1.2.3.4 - - [15/Apr/2019:14:30:16 -0400] "GET /bar.html HTTP/2.0" 500 - "https://foo.com/referer.html" "Mozilla/5.0 ..." +{% endlog %} The {{ site.product.short_name }} application extracts every field into name-value pairs, and adds the .apache. prefix to the name of the field. diff --git a/doc/_admin-guide/120_Parser/002_Checkpoint_parser.md b/doc/_admin-guide/120_Parser/002_Checkpoint_parser.md index fe94fe11..d23fc2b0 100644 --- a/doc/_admin-guide/120_Parser/002_Checkpoint_parser.md +++ b/doc/_admin-guide/120_Parser/002_Checkpoint_parser.md @@ -14,11 +14,15 @@ The parser can parse messages in the following formats: For example: -><134>1 2018-03-21 17:25:25 MDS-72 CheckPoint 13752 - [action:"Update"; flags:"150784"; ifdir:"inbound"; logid:"160571424"; loguid:"{0x5ab27965,0x0,0x5b20a8c0,0x7d5707b6}";] +{% log %} +<134>1 2018-03-21 17:25:25 MDS-72 CheckPoint 13752 - [action:"Update"; flags:"150784"; ifdir:"inbound"; logid:"160571424"; loguid:"{0x5ab27965,0x0,0x5b20a8c0,0x7d5707b6}";] +{% endlog %} Splunk format: ->time=1557767758|hostname=r80test|product=Firewall|layer_name=Network|layer_uuid=c0264a80-1832-4fce-8a90-d0849dc4ba33|match_id=1|parent_rule=0|rule_action=Accept|rule_uid=4420bdc0-19f3-4a3e-8954-03b742cd3aee|action=Accept|ifdir=inbound|ifname=eth0|logid=0|loguid={0x5cd9a64e,0x0,0x5060a8c0,0xc0000001}|origin=192.168.96.80|originsicname=cn\=cp_mgmt,o\=r80test..ymydp2|sequencenum=1|time=1557767758|version=5|dst=192.168.96.80|inzone=Internal|outzone=Local|proto=6|s_port=63945|service=443|service_id=https|src=192.168.96.27| +{% log %} +time=1557767758|hostname=r80test|product=Firewall|layer_name=Network|layer_uuid=c0264a80-1832-4fce-8a90-d0849dc4ba33|match_id=1|parent_rule=0|rule_action=Accept|rule_uid=4420bdc0-19f3-4a3e-8954-03b742cd3aee|action=Accept|ifdir=inbound|ifname=eth0|logid=0|loguid={0x5cd9a64e,0x0,0x5060a8c0,0xc0000001}|origin=192.168.96.80|originsicname=cn\=cp_mgmt,o\=r80test..ymydp2|sequencenum=1|time=1557767758|version=5|dst=192.168.96.80|inzone=Internal|outzone=Local|proto=6|s_port=63945|service=443|service_id=https|src=192.168.96.27| +{% endlog %} {% include doc/admin-guide/parser-support.md %} diff --git a/doc/_admin-guide/120_Parser/003_Cisco_parser.md b/doc/_admin-guide/120_Parser/003_Cisco_parser.md index f0302cd2..663a3fe6 100644 --- a/doc/_admin-guide/120_Parser/003_Cisco_parser.md +++ b/doc/_admin-guide/120_Parser/003_Cisco_parser.md @@ -15,11 +15,13 @@ message format: For example: -><189>29: foo: *Apr 29 13:58:40.411: %SYS-5-CONFIG_I: Configured from console by console -><190>30: foo: *Apr 29 13:58:46.411: %SYS-6-LOGGINGHOST_STARTSTOP: Logging to host 192.168.1.239 stopped - CLI initiated -><190>31: foo: *Apr 29 13:58:46.411: %SYS-6-LOGGINGHOST_STARTSTOP: Logging to host 192.168.1.239 started - CLI initiated -><189>32: 0.0.0.0: *Apr 29 13:59:12.491: %SYS-5-CONFIG_I: Configured from console by console -><189>32: foo: *Apr 29 13:58:46.411: %SYSMGR-STANDBY-3-SHUTDOWN_START: The System Manager has started the shutdown procedure. +{% log %} +<189>29: foo: *Apr 29 13:58:40.411: %SYS-5-CONFIG_I: Configured from console by console +<190>30: foo: *Apr 29 13:58:46.411: %SYS-6-LOGGINGHOST_STARTSTOP: Logging to host 192.168.1.239 stopped - CLI initiated +<190>31: foo: *Apr 29 13:58:46.411: %SYS-6-LOGGINGHOST_STARTSTOP: Logging to host 192.168.1.239 started - CLI initiated +<189>32: 0.0.0.0: *Apr 29 13:59:12.491: %SYS-5-CONFIG_I: Configured from console by console +<189>32: foo: *Apr 29 13:58:46.411: %SYSMGR-STANDBY-3-SHUTDOWN_START: The System Manager has started the shutdown procedure. +{% endlog %} **NOTE:** Not every Cisco log message conforms to this format. If you find a message that the cisco-parser() cannot properly parse, contact Support, so we can improve the parser. {: .notice--info} @@ -27,8 +29,10 @@ For example: The {{ site.product.short_name }} application normalizes the parsed log messages into the following format: ->${MESSAGE}=%FAC-SEV-MNEMONIC: message ->${HOST}=origin-id +{% log %} +${MESSAGE}=%FAC-SEV-MNEMONIC: message +${HOST}=origin-id +{% endlog %} By default, the Cisco-specific fields are extracted into the following name-value pairs:${.cisco.facility}, ${.cisco.severity}, diff --git a/doc/_admin-guide/120_Parser/004_CSV_parser/README.md b/doc/_admin-guide/120_Parser/004_CSV_parser/README.md index 92151297..53c7a74a 100644 --- a/doc/_admin-guide/120_Parser/004_CSV_parser/README.md +++ b/doc/_admin-guide/120_Parser/004_CSV_parser/README.md @@ -93,7 +93,9 @@ formatted like: Here is a sample message: ->192.168.1.1 - - [31/Dec/2007:00:17:10 +0100] "GET /cgi-bin/example.cgi HTTP/1.1" 200 2708 "-" "curl/7.15.5 (i4 >86-pc-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8c zlib/1.2.3 libidn/0.6.5" 2 example.mycompany +{% log %} +192.168.1.1 - - [31/Dec/2007:00:17:10 +0100] "GET /cgi-bin/example.cgi HTTP/1.1" 200 2708 "-" "curl/7.15.5 (i4 >86-pc-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8c zlib/1.2.3 libidn/0.6.5" 2 example.mycompany +{% endlog %} To parse such logs, the delimiter character is set to a single whitespace (delimiters(\" \")). Whitespaces between quotes and brackets diff --git a/doc/_admin-guide/120_Parser/006_db_parser/001_Using_pattern_databases/002_Correlating_log_messages.md b/doc/_admin-guide/120_Parser/006_db_parser/001_Using_pattern_databases/002_Correlating_log_messages.md index 12531617..d47552bc 100644 --- a/doc/_admin-guide/120_Parser/006_db_parser/001_Using_pattern_databases/002_Correlating_log_messages.md +++ b/doc/_admin-guide/120_Parser/006_db_parser/001_Using_pattern_databases/002_Correlating_log_messages.md @@ -69,8 +69,10 @@ Note the following points about timeout values: Consider the following two messages: - ><38>1990-01-01T14:45:25 customhostname program6[1234]: program6 testmessage\ - ><38>1990-01-01T14:46:25 customhostname program6[1234]: program6 testmessage + {% log %} + <38>1990-01-01T14:45:25 customhostname program6[1234]: program6 testmessage + <38>1990-01-01T14:46:25 customhostname program6[1234]: program6 testmessage + {% endlog %} If the context-timeout is 10 seconds and {{ site.product.short_name }} receives the messages within 1 second, the timeout event will occour immediately, diff --git a/doc/_admin-guide/120_Parser/006_db_parser/004_The_syslog-ng_patterndb_format/README.md b/doc/_admin-guide/120_Parser/006_db_parser/004_The_syslog-ng_patterndb_format/README.md index b97ab872..1f908fe7 100644 --- a/doc/_admin-guide/120_Parser/006_db_parser/004_The_syslog-ng_patterndb_format/README.md +++ b/doc/_admin-guide/120_Parser/006_db_parser/004_The_syslog-ng_patterndb_format/README.md @@ -24,7 +24,9 @@ The pdbtool manual page. The following pattern database contains a single rule that matches a log message of the ssh application. A sample log message looks like: ->Accepted password for sampleuser from 10.50.0.247 port 42156 ssh2 +{% log %} +Accepted password for sampleuser from 10.50.0.247 port 42156 ssh2 +{% endlog %} The following is a simple pattern database containing a matching rule. diff --git a/doc/_admin-guide/120_Parser/008_Fortigate_parser/README.md b/doc/_admin-guide/120_Parser/008_Fortigate_parser/README.md index f7065c42..bc7e0e84 100644 --- a/doc/_admin-guide/120_Parser/008_Fortigate_parser/README.md +++ b/doc/_admin-guide/120_Parser/008_Fortigate_parser/README.md @@ -15,7 +15,9 @@ The parser can parse messages in the following format: For example: -><189>date=2021-01-15 time=12:58:59 devname="FORTI_111" devid="FG100D3G12801312" logid="0001000014" type="traffic" subtype="local" level="notice" vd="root" eventtime=1610704739683510055 tz="+0300" srcip=91.234.154.139 srcname="91.234.154.139" srcport=45295 srcintf="wan1" srcintfrole="wan" dstip=213.59.243.9 dstname="213.59.243.9" dstport=46730 dstintf="unknown0" dstintfrole="undefined" sessionid=2364413215 proto=17 action="deny" policyid=0 policytype="local-in-policy" service="udp/46730" dstcountry="Russian Federation" srccountry="Russian Federation" trandisp="noop" app="udp/46730" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 appcat="unscanned" crscore=5 craction=262144 crlevel="low" +{% log %} +<189>date=2021-01-15 time=12:58:59 devname="FORTI_111" devid="FG100D3G12801312" logid="0001000014" type="traffic" subtype="local" level="notice" vd="root" eventtime=1610704739683510055 tz="+0300" srcip=91.234.154.139 srcname="91.234.154.139" srcport=45295 srcintf="wan1" srcintfrole="wan" dstip=213.59.243.9 dstname="213.59.243.9" dstport=46730 dstintf="unknown0" dstintfrole="undefined" sessionid=2364413215 proto=17 action="deny" policyid=0 policytype="local-in-policy" service="udp/46730" dstcountry="Russian Federation" srccountry="Russian Federation" trandisp="noop" app="udp/46730" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 appcat="unscanned" crscore=5 craction=262144 crlevel="low" +{% endlog %} {% include doc/admin-guide/parser-support.md %} diff --git a/doc/_admin-guide/120_Parser/011_key-value_pairs_parser/000_kv_parser_options.md b/doc/_admin-guide/120_Parser/011_key-value_pairs_parser/000_kv_parser_options.md index 7d61c899..43545a57 100644 --- a/doc/_admin-guide/120_Parser/011_key-value_pairs_parser/000_kv_parser_options.md +++ b/doc/_admin-guide/120_Parser/011_key-value_pairs_parser/000_kv_parser_options.md @@ -24,7 +24,9 @@ name-value pair storing the stray words. Default value:**N/A** For example, consider the following message: ->VSYS=public; Slot=5/1; protocol=17; source-ip=10.116.214.221; source-port=50989; destination-ip=172.16.236.16; >destination-port=162;time=2016/02/18 16:00:07; interzone-emtn_s1_vpn-enodeb_om; inbound; policy=370; +{% log %} +VSYS=public; Slot=5/1; protocol=17; source-ip=10.116.214.221; source-port=50989; destination-ip=172.16.236.16; >destination-port=162;time=2016/02/18 16:00:07; interzone-emtn_s1_vpn-enodeb_om; inbound; policy=370; +{% endlog %} This is a list of key-value pairs, where the value separator is **=** and the pair separator is **;**. However, before the last key-value pair diff --git a/doc/_admin-guide/120_Parser/011_key-value_pairs_parser/README.md b/doc/_admin-guide/120_Parser/011_key-value_pairs_parser/README.md index ca1f13ab..3ee8c885 100644 --- a/doc/_admin-guide/120_Parser/011_key-value_pairs_parser/README.md +++ b/doc/_admin-guide/120_Parser/011_key-value_pairs_parser/README.md @@ -54,8 +54,9 @@ parser parser_name { In the following example, the source is a log message consisting of comma-separated key=value pairs, for example, a Postfix log message: ->Jun 20 12:05:12 mail.example.com
") + output << "