summaryrefslogtreecommitdiffstats
path: root/collectors/log2journal/tests.d/full.yaml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:57:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:57:58 +0000
commitbe1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 (patch)
tree9754ff1ca740f6346cf8483ec915d4054bc5da2d /collectors/log2journal/tests.d/full.yaml
parentInitial commit. (diff)
downloadnetdata-upstream.tar.xz
netdata-upstream.zip
Adding upstream version 1.44.3.upstream/1.44.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--collectors/log2journal/tests.d/full.yaml76
1 files changed, 76 insertions, 0 deletions
diff --git a/collectors/log2journal/tests.d/full.yaml b/collectors/log2journal/tests.d/full.yaml
new file mode 100644
index 00000000..86cafb5a
--- /dev/null
+++ b/collectors/log2journal/tests.d/full.yaml
@@ -0,0 +1,76 @@
+pattern: |
+ (?x) # Enable PCRE2 extended mode
+ ^
+ (?<NGINX_REMOTE_ADDR>[^ ]+) \s - \s # NGINX_REMOTE_ADDR
+ (?<NGINX_REMOTE_USER>[^ ]+) \s # NGINX_REMOTE_USER
+ \[
+ (?<NGINX_TIME_LOCAL>[^\]]+) # NGINX_TIME_LOCAL
+ \]
+ \s+ "
+ (?<MESSAGE>
+ (?<NGINX_METHOD>[A-Z]+) \s+ # NGINX_METHOD
+ (?<NGINX_URL>[^ ]+) \s+
+ HTTP/(?<NGINX_HTTP_VERSION>[^"]+)
+ )
+ " \s+
+ (?<NGINX_STATUS>\d+) \s+ # NGINX_STATUS
+ (?<NGINX_BODY_BYTES_SENT>\d+) \s+ # NGINX_BODY_BYTES_SENT
+ "(?<NGINX_HTTP_REFERER>[^"]*)" \s+ # NGINX_HTTP_REFERER
+ "(?<NGINX_HTTP_USER_AGENT>[^"]*)" # NGINX_HTTP_USER_AGENT
+
+prefix: NGINX_
+
+filename:
+ key: NGINX_LOG_FILENAME
+
+filter:
+ include: '.*'
+ exclude: '.*HELLO.*WORLD.*'
+
+rename:
+ - new_key: TEST1
+ old_key: TEST2
+ - new_key: TEST3
+ old_key: TEST4
+
+inject:
+ - key: SYSLOG_IDENTIFIER
+ value: 'nginx-log'
+ - key: SYSLOG_IDENTIFIER2
+ value: 'nginx-log2'
+ - key: PRIORITY
+ value: '${NGINX_STATUS}'
+ - key: NGINX_STATUS_FAMILY
+ value: '${NGINX_STATUS}${NGINX_METHOD}'
+
+rewrite:
+ - key: "PRIORITY"
+ value: "${NGINX_STATUS}"
+ inject: yes
+ stop: no
+ - key: "PRIORITY"
+ match: "^[123]"
+ value: 6
+ - key: "PRIORITY"
+ match: "^4"
+ value: 5
+ - key: "PRIORITY"
+ match: "^5"
+ value: 3
+ - key: "PRIORITY"
+ match: ".*"
+ value: 4
+ - key: "NGINX_STATUS_FAMILY"
+ match: "^(?<first_digit>[1-5])"
+ value: "${first_digit}xx"
+ - key: "NGINX_STATUS_FAMILY"
+ match: ".*"
+ value: "UNKNOWN"
+
+unmatched:
+ key: MESSAGE
+ inject:
+ - key: PRIORITY
+ value: 1
+ - key: PRIORITY2
+ value: 2