sources:
docker:
type: "docker_logs"
{{ service_name }}-journal:
type: "journald"
include_units: ["{{ service_name }}"]
journal_directory: "/var/log/journal"
sdf-migration:
type: "journald"
include_matches:
SYSLOG_IDENTIFIER: ["sdf-migration"]
journal_directory: "/var/log/journal"
transforms:
honeycomb_format:
type: remap
inputs: ["{{ service_name }}-journal", "sdf-migration"]
source: |-
if exists(.message) {
message = string!(.message)
if contains(message, "ERROR") {
.level = "error"
} else if contains(message, "WARN") {
.level = "warn"
} else if contains(message, "DEBUG") {
.level = "debug"
} else if contains(message, "TRACE") {
.level = "trace"
} else {
.level = "info"
}
}
sinks:
cloudwatch:
type: "aws_cloudwatch_logs"
inputs: ["{{ service_name }}-journal", "sdf-migration"]
compression: "gzip"
encoding:
codec: "text"
region: "us-east-1"
group_name: "/ec2/{{ host_environment }}-{{ service_name }}"
stream_name: "{{ instance_id }}"
cloudwatch-docker:
type: "aws_cloudwatch_logs"
inputs: ["docker"]
compression: "gzip"
encoding:
codec: "text"
region: "us-east-1"
group_name: "/ec2/{{ host_environment }}-{{ service_name }}-docker"
stream_name: "{{ instance_id }}"
honeycomb:
type: "honeycomb"
inputs: ["honeycomb_format"]
api_key: "{{ honeycomb_api_key }}"
dataset: "{{ service_name }}"