summaryrefslogtreecommitdiffstats
path: root/test/bad-config
diff options
context:
space:
mode:
Diffstat (limited to 'test/bad-config')
-rw-r--r--test/bad-config/formats/invalid-file-format/format.json27
-rw-r--r--test/bad-config/formats/invalid-no-tscap/format.json32
2 files changed, 59 insertions, 0 deletions
diff --git a/test/bad-config/formats/invalid-file-format/format.json b/test/bad-config/formats/invalid-file-format/format.json
new file mode 100644
index 0000000..cca2b47
--- /dev/null
+++ b/test/bad-config/formats/invalid-file-format/format.json
@@ -0,0 +1,27 @@
+{
+ "$schema": "https://lnav.org/schemas/format-v1.schema.json",
+ "bad_file_format1": {
+ "title": "bad file format",
+ "regex": {
+ "std": {
+ "pattern": "(?<timestamp>\\d+): (?<body>.*)$"
+ }
+ },
+ "converter": {
+ "header": {
+ "expr": {
+ "default": ":header REGEXP 'foobar"
+ },
+ "size": 8
+ }
+ },
+ "timestamp-format": [
+ "%i"
+ ],
+ "sample": [
+ {
+ "line": "1234: abcd"
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/test/bad-config/formats/invalid-no-tscap/format.json b/test/bad-config/formats/invalid-no-tscap/format.json
new file mode 100644
index 0000000..5e8eb14
--- /dev/null
+++ b/test/bad-config/formats/invalid-no-tscap/format.json
@@ -0,0 +1,32 @@
+{
+ "$schema": "https://lnav.org/schemas/format-v1.schema.json",
+ "no_tscap_log": {
+ "title": "Sample with no captured timestamp",
+ "multiline": true,
+ "ordered-by-time": false,
+ "regex": {
+ "std": {
+ "pattern": "^(?<container>[\\w-]+)\\s+\\|( (?<timestamp>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{9}[+-]\\d{2}:\\d{2}))?( (?<body>.*))?$"
+ }
+ },
+ "level-field": "timestamp",
+ "module-field": "container",
+ "value": {
+ "container": {
+ "kind": "string",
+ "identifier": true
+ }
+ },
+ "sample": [
+ {
+ "line": "gitea | 2023-09-24T22:15:55.346526305+02:00 2023/09/24 22:15:55 cmd/web.go:223:runWeb() [I] Starting Gitea on PID: 7"
+ },
+ {
+ "line": "gitea | 2023/09/24 22:15:55 cmd/web.go:223:runWeb() [I] Starting Gitea on PID: 7"
+ },
+ {
+ "line": "gitea-db-1 | 2023-09-24T22:15:37.981051393+02:00 [migrations] started"
+ }
+ ]
+ }
+} \ No newline at end of file