Skip to content

Commit

Permalink
Adds origin@48577 SD data (#70)
Browse files Browse the repository at this point in the history
StrongestNumber9 authored Jul 26, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent d1d49a5 commit 844f16d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/teragrep/k8s_01/K8SConsumer.java
Original file line number Diff line number Diff line change
@@ -282,6 +282,8 @@ public void accept(FileRecord record) {
}

// Craft syslog message and structured-data
SDElement SDOrigin = new SDElement("origin@48577")
.addSDParam("hostname", podMetadataContainer.getHost() + "/" + containerId);
SDElement SDMetadata = new SDElement("kubernetesmeta@48577")
.addSDParam("kubernetes", kubernetesMetadata.toString())
.addSDParam("docker", dockerMetadata.toString())
@@ -302,6 +304,7 @@ public void accept(FileRecord record) {
.withHostname(hostname)
.withAppName(appName)
.withFacility(Facility.USER)
.withSDElement(SDOrigin)
.withSDElement(SDMetadata)
.withMsg(new String(record.getRecord(), StandardCharsets.UTF_8));
try {

0 comments on commit 844f16d

Please sign in to comment.