-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1600 from kube-logging/syslog-ng-date-parser
syslog-ng: add source date-parser
- Loading branch information
Showing
14 changed files
with
253 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
kind: Logging | ||
apiVersion: logging.banzaicloud.io/v1beta1 | ||
metadata: | ||
name: logging | ||
spec: | ||
controlNamespace: default | ||
fluentbit: {} | ||
syslogNG: | ||
globalOptions: | ||
log_level: trace | ||
--- | ||
apiVersion: logging.banzaicloud.io/v1beta1 | ||
kind: SyslogNGFlow | ||
metadata: | ||
name: all1 | ||
spec: | ||
match: {} | ||
localOutputRefs: | ||
- http | ||
- http2 | ||
--- | ||
apiVersion: logging.banzaicloud.io/v1beta1 | ||
kind: SyslogNGFlow | ||
metadata: | ||
name: all2 | ||
spec: | ||
match: {} | ||
localOutputRefs: | ||
- http | ||
- http2 | ||
--- | ||
apiVersion: logging.banzaicloud.io/v1beta1 | ||
kind: SyslogNGOutput | ||
metadata: | ||
name: http | ||
spec: | ||
file: | ||
path: "/tmp/log" | ||
--- | ||
apiVersion: logging.banzaicloud.io/v1beta1 | ||
kind: SyslogNGOutput | ||
metadata: | ||
name: http2 | ||
spec: | ||
file: | ||
path: "/tmp/log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## syslog-ng date parser | ||
|
||
By default, the syslog-ng aggregator uses the time when a message has been received on its input source as the timestamp. | ||
In case we want to use the timestamp written in the message metadata, we should use a [date-parser](https://axoflow.com/docs/axosyslog-core/chapter-parsers/date-parser/date-parser-options/). | ||
|
||
To enable the timestamps written by the container runtime (_cri_ or _docker_) and parsed by fluentbit automatically, we just | ||
have to define the `sourceDateParser` in the _syslog-ng_ spec. | ||
|
||
``` | ||
kind: Logging | ||
metadata: | ||
name: example | ||
spec: | ||
syslogNG: | ||
sourceDateParser: {} | ||
``` | ||
|
||
In case we want to define our own parser format and template we can also do so (these are the default values): | ||
|
||
``` | ||
kind: Logging | ||
metadata: | ||
name: example | ||
spec: | ||
syslogNG: | ||
sourceDateParser: | ||
format: "%FT%T.%f%z" | ||
template: "${json.time}" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters