Created
August 28, 2022 22:14
-
-
Save mdfranz/3e1e0ffbfa8123ff2d888b9b4a9df17e to your computer and use it in GitHub Desktop.
k3s and iptables logs to CloudWatch with Vector
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
# See the Vector Remap Language reference for more info: https://vrl.dev | |
[sources.k3s] | |
type = "journald" | |
include_units = ["k3s"] | |
[sources.kernel] | |
type = "file" | |
include = ["/var/log/messages"] | |
[transforms.iptables_parse] | |
inputs = ["kernel"] | |
type = "remap" | |
source = """ | |
.iptables = parse_syslog!(.message) | |
.packet = parse_key_value!(.iptables.message) | |
""" | |
[sinks.cloudwatch] | |
type = "aws_cloudwatch_logs" | |
inputs = [ "k3s","iptables_parse" ] | |
create_missing_group = false | |
create_missing_stream = true | |
group_name = "k3s-honeynet" | |
compression = "none" | |
region = "us-east-2" | |
stream_name = "{{host}}" | |
[sinks.cloudwatch.encoding] | |
codec = "json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment