diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 17:44:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 17:44:55 +0000 |
commit | 5068d34c08f951a7ea6257d305a1627b09a95817 (patch) | |
tree | 08213e2be853396a3b07ce15dbe222644dcd9a89 /test/formats/jsontest | |
parent | Initial commit. (diff) | |
download | lnav-5068d34c08f951a7ea6257d305a1627b09a95817.tar.xz lnav-5068d34c08f951a7ea6257d305a1627b09a95817.zip |
Adding upstream version 0.11.1.upstream/0.11.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/formats/jsontest')
-rw-r--r-- | test/formats/jsontest/format.json | 36 | ||||
-rw-r--r-- | test/formats/jsontest/lnav-logstash.json | 47 | ||||
-rw-r--r-- | test/formats/jsontest/rewrite-user.lnav | 2 |
3 files changed, 85 insertions, 0 deletions
diff --git a/test/formats/jsontest/format.json b/test/formats/jsontest/format.json new file mode 100644 index 0000000..78300e9 --- /dev/null +++ b/test/formats/jsontest/format.json @@ -0,0 +1,36 @@ +{ + "$schema": "https://lnav.org/schemas/format-v1.schema.json", + "test_log" : { + "title" : "Test JSON Log", + "json" : true, + "file-pattern" : "logfile_json\\.json", + "description" : "Test config", + "line-format" : [ + "\n[", + { "field" : "ts" }, + "] ", + { "field" : "lvl" }, + " ", + { "field" : "msg" } + ], + "level-field" : "lvl", + "timestamp-field": "ts", + "body-field" : "msg", + "value" : { + "msg" : { + "rewriter" : ";SELECT :msg || 'bork bork bork'" + }, + "arr" : { + "kind" : "json" + }, + "obj" : { + "kind" : "json" + }, + "user" : { + "kind" : "string", + "identifier" : true, + "rewriter" : "|rewrite-user" + } + } + } +} diff --git a/test/formats/jsontest/lnav-logstash.json b/test/formats/jsontest/lnav-logstash.json new file mode 100644 index 0000000..27f9239 --- /dev/null +++ b/test/formats/jsontest/lnav-logstash.json @@ -0,0 +1,47 @@ +{ + "$schema": "https://lnav.org/schemas/format-v1.schema.json", + "logstash_dam": { + "title": "Logstash Java JSON", + "url": "https://github.com/logstash/logstash-logback-encoder", + "description": "Log format for DAM Logstash JSON", + "json": true, + "hide-extra": false, + "file-pattern": "\\.clog.*", + "multiline": false, + "line-format": [ + { "field" : "@timestamp" }, + " ", + { "field" : "ipaddress" }, + " ", + { "field" : "message" }, + " ", + { "field" : "stack_trace", "default-value" : "" } + ], + "timestamp-field" : "@timestamp", + "body-field" : "message", + "level-field" : "level", + "level" : { + "trace" : "TRACE", + "debug" : "DEBUG", + "info" : "INFO", + "error" : "ERROR", + "warning" : "WARN" + }, + "value" : { + "logger_name" : { + "kind" : "string", + "identifier" : true + }, + "ipaddress" : { + "kind" : "string", + "identifier" : true + }, + "level_value" : { + "hidden": true + }, + "stack_trace" : { + "kind" : "string" + } + } + } +} diff --git a/test/formats/jsontest/rewrite-user.lnav b/test/formats/jsontest/rewrite-user.lnav new file mode 100644 index 0000000..e34aa78 --- /dev/null +++ b/test/formats/jsontest/rewrite-user.lnav @@ -0,0 +1,2 @@ + +;SELECT 'mailto:' || :user |