The OpsRamp Kubernetes 2.0 Agent automatically classifies the severity of every pod log entry and assigning a level like Info, Error, or Fatal before the log is sent to the OpsRamp platform. You can then use that classification to filter out low-value logs (like routine Info messages) so only logs above a chosen severity threshold reach the platform.

This page explains how the agent determines a log’s severity, and how to configure filtering based on it.

Prerequisites

How the Agent classifies log severity

The agent evaluates each pod log entry using three detection methods, applied in order. As soon as one method finds a match, classification stops and the agent does not continue checking the remaining methods.

1. Klog prefix detection

Kubernetes system components (kube-apiserver, kube-scheduler, kubelet, etcd, and others) use the klog logging library, which prefixes each line with a single character and a timestamp:

I0607 12:30:45.123456  12345 controller.go:100] Starting reconciliation
E0607 12:30:46.654321  12345 controller.go:150] Failed to reconcile resource

The agent detects the following klog prefixes:

Klog PrefixAssigned SeverityMeaning
F + digits (for example, F0607)FatalIndicates a fatal error that causes the component to exit.
E + digits (for example, E0607)ErrorIndicates an error condition that requires attention.
W + digits (for example, W0607)WarnIndicates a warning about a potential issue.
I + digits (for example, I0607)InfoIndicates an informational message about normal operation.
D + digits (for example, D0607)DebugIndicates a debug-level message used for troubleshooting.

Example: W0607 14:22:03.456789 54321 handler.go:200] Deprecated API version called is classified as Warn, because it starts with the W prefix followed by digits.

2. Keyword-based detection

If a log entry doesn’t match a klog prefix, the agent scans the log body for severity keywords, using word-boundary matching. This means, the keyword must stand alone (surrounded by non-alphanumeric characters, or the start/end of the line), not be embedded inside another word.

Keyword (and Variants)Assigned Severity
emerg, emergency, emergenciesEmergency
alert, alertsAlert
crit, critical, criticalsCritical
fatal, fatalsFatal
error, errorsError
exceptionError
warn, warning, warningsWarn
noticeNotice
info, infos, information, informationalInfo
verboseVerbose
debugDebug
trace, tracesTrace

Matching is case-insensitive. For example, error inside myerrorhandler does not match (it’s embedded in another word), but [ERROR] or error: does match (it’s a standalone token).

Example: 2026-07-07 10:15:30 ERROR [main] com.app.Service - Connection refused is classified as Error, because ERROR is detected as a standalone keyword.

3. stdout/stderr stream fallback

If neither a klog prefix nor a keyword is found, the agent falls back to the container’s output stream:

StreamAssigned Severity
stderrError
stdoutInfo

Example: connection pool exhausted, retrying in 5s written to stderr, with no matching keyword, is classified as Error — purely because of the stream it came from.

This fallback also applies to empty or missing log bodies: an empty message on stderr is classified as Error, and on stdout as Info.

Severity level ordering

The full severity hierarchy, from highest to lowest:

Emergency = Alert = Critical = Fatal > Error > Warn > Notice = Info > Verbose = Debug > Trace > Unspecified/Unknown

Levels joined by = share the same priority tier for filtering purposes, for example, filtering at Fatal also keeps Emergency, Alert, and Critical logs, since they’re all in the same tier.

Configuring log-level filter

Set the log_level field under pods in the opsramp-logs-user-config ConfigMap to your desired threshold:

kubectl edit configmap opsramp-logs-user-config -n <agent-installed-namespace>
pods:
  enable: true
  log_level: "Warn"

This example keeps logs classified as Warn or higher (Warn, Error, Fatal, Critical, Alert, Emergency) and drops everything below Warn (Notice, Info, Verbose, Debug, Trace, Unspecified/Unknown).

Note: log_level accepts only string values and is case-insensitive. Valid values are: Emergency, Alert, Critical, Fatal, Error, Warn, Notice, Info, Verbose, Debug, Trace, Unspecified. The default is Unspecified, which applies no filtering and sends all logs.

What gets kept at each filter level

Filter Set ToDroppedKept
TraceUnknownTrace, Debug, Verbose, Info, Notice, Warn, Error, Fatal, Critical, Alert, Emergency
Debug / VerboseUnknown, TraceDebug, Verbose, Info, Notice, Warn, Error, Fatal, Critical, Alert, Emergency
Info / NoticeUnknown, Trace, Debug, VerboseInfo, Notice, Warn, Error, Fatal, Critical, Alert, Emergency
WarnUnknown, Trace, Debug, Verbose, Info, NoticeWarn, Error, Fatal, Critical, Alert, Emergency
ErrorUnknown, Trace, Debug, Verbose, Info, Notice, WarnError, Fatal, Critical, Alert, Emergency
Fatal / Emergency / Alert / CriticalUnknown, Trace, Debug, Verbose, Info, Notice, Warn, ErrorFatal, Critical, Alert, Emergency
Unspecified (Default)All log entries, including Unknown; no filtering is applied.

Examples

ScenarioLog ContentClassification MethodAssigned Severity
Kubernetes component log with klog formatI0607 12:30:45.123 12345 main.go:50] Server startedKlog prefix (I)Info
Kubernetes component log with errorE0607 12:30:46.456 12345 main.go:60] Panic recoveredKlog prefix (E)Error
Application log with keyword2026-07-07 WARN Disk usage above 80%Keyword (WARN)Warn
Application log with exception at word boundaryException in thread "main" java.lang.NullPointerExceptionKeyword (Exception at the start of the line)Error
Application log with embedded exception (no boundary)java.lang.NullPointerException: nullStream fallback (no keyword boundary match)Error on stderr, Info on stdout
Application log with error keyword[ERROR] Failed to connect to databaseKeyword (ERROR)Error
Unstructured log on stderrsegfault at 0x0000Stream fallback (stderr)Error
Unstructured log on stdoutready to accept connectionsStream fallback (stdout)Info
Log with empty body on stderrEmpty log body on stderrStream fallback (stderr)Error
Log with empty body on stdoutEmpty log body on stdoutStream fallback (stdout)Info