Skip to content

Commit

Permalink
new: added config schema (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
pamburus committed May 30, 2024
1 parent 97bc2dc commit 321e2e8
Show file tree
Hide file tree
Showing 4 changed files with 295 additions and 0 deletions.
2 changes: 2 additions & 0 deletions etc/defaults/config-ecs.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/pamburus/hl/master/schema/json/config.json

# Settings for fields processing.
fields:
# Configuration of the predefined set of fields.
Expand Down
2 changes: 2 additions & 0 deletions etc/defaults/config-k8s.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/pamburus/hl/master/schema/json/config.json

# Settings for fields processing.
fields:
# Configuration of the predefined set of fields.
Expand Down
2 changes: 2 additions & 0 deletions etc/defaults/config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/pamburus/hl/master/schema/json/config.json

# Time format, see https://man7.org/linux/man-pages/man1/date.1.html for details.
time-format: '%b %d %T.%3N'

Expand Down
289 changes: 289 additions & 0 deletions schema/json/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,289 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"time-format": {
"type": "string"
},
"time-zone": {
"type": "string"
},
"fields": {
"type": "object",
"additionalProperties": false,
"properties": {
"predefined": {
"type": "object",
"additionalProperties": false,
"properties": {
"time": {
"type": "object",
"additionalProperties": false,
"properties": {
"show": {
"type": "string"
},
"names": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"names"
]
},
"logger": {
"type": "object",
"additionalProperties": false,
"properties": {
"names": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"names"
]
},
"level": {
"type": "object",
"additionalProperties": false,
"properties": {
"show": {
"type": "string"
},
"variants": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"names": {
"type": "array",
"items": {
"type": "string"
}
},
"values": {
"type": "object",
"additionalProperties": false,
"properties": {
"debug": {
"type": "array",
"items": {
"type": [
"string",
"integer"
]
}
},
"info": {
"type": "array",
"items": {
"type": [
"string",
"integer"
]
}
},
"warning": {
"type": "array",
"items": {
"type": [
"string",
"integer"
]
}
},
"error": {
"type": "array",
"items": {
"type": [
"string",
"integer"
]
}
}
}
},
"level": {
"type": "string",
"enum": [
"debug",
"info",
"warning",
"error"
]
}
},
"required": [
"names"
]
}
}
},
"required": [
"variants"
]
},
"message": {
"type": "object",
"additionalProperties": false,
"properties": {
"names": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"names"
]
},
"caller": {
"type": "object",
"additionalProperties": false,
"properties": {
"names": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"names"
]
},
"caller-file": {
"type": "object",
"additionalProperties": false,
"properties": {
"names": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"names"
]
},
"caller-line": {
"type": "object",
"additionalProperties": false,
"properties": {
"names": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"names"
]
}
}
},
"ignore": {
"type": "array",
"items": [
{
"type": "string"
}
]
},
"hide": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"formatting": {
"type": "object",
"additionalProperties": false,
"properties": {
"flatten": {
"type": "string",
"enum": [
"never",
"always"
]
},
"punctuation": {
"type": "object",
"additionalProperties": false,
"properties": {
"logger-name-separator": {
"type": "string"
},
"field-key-value-separator": {
"type": "string"
},
"string-opening-quote": {
"type": "string"
},
"string-closing-quote": {
"type": "string"
},
"source-location-separator": {
"type": "string"
},
"hidden-fields-indicator": {
"type": "string"
},
"level-left-separator": {
"type": "string"
},
"level-right-separator": {
"type": "string"
},
"input-number-prefix": {
"type": "string"
},
"input-number-left-separator": {
"type": "string"
},
"input-number-right-separator": {
"type": "string"
},
"input-name-left-separator": {
"type": "string"
},
"input-name-right-separator": {
"type": "string"
},
"input-name-clipping": {
"type": "string"
},
"input-name-common-part": {
"type": "string"
},
"array-separator": {
"type": "string"
}
}
}
}
},
"concurrency": {
"type": [
"integer",
"null"
]
},
"theme": {
"type": "string"
}
}
}

0 comments on commit 321e2e8

Please sign in to comment.