Config

Agent Configuration

The Logship agent is configured through a JSON file called appsettings.json. The configuration controls where collected data is sent, what data sources are enabled, and how the agent behaves.

You can find an example configuration in the agent source on GitHub.

The configuration file has three top-level sections:

  • Output — where to send collected data
  • Sources — which data sources to enable and how to configure them
  • Logging — log verbosity for the agent itself

Example

{
  "Output": {
    "endpoint": "https://localhost:5000",
    "account": "00000000-0000-0000-0000-000000000000",
    "interval": "00:00:02",
    "maximumBufferSize": 40000,
    "maximumFlushSize": 15000,
    "health": {
      "interval": "00:00:05"
    },
    "registration": {
      "registrationToken": ""
    }
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information"
    }
  },
  "Sources": {
    "DiskInformation": {
      "enabled": true,
      "interval": "00:00:05"
    },
    "SystemInformation": {
      "enabled": true,
      "interval": "01:00:00"
    },
    "NetworkInformation": {
      "enabled": true,
      "interval": "00:00:15"
    },
    "ProcessInformation": {
      "enabled": true,
      "interval": "00:00:30"
    },
    "UDPListener": {
      "enabled": true,
      "port": 49999
    }
  }
}

Output

The Output section controls where the agent sends collected data and how it batches uploads.

FieldTypeRequiredDefaultDescription
endpointstringYes"console"The HTTP endpoint to ship data to. Use "console" to print collected data to stdout instead of uploading.
accountguidYes00000000-...The account ID under which to upload collected data.
intervaltimespanNo00:00:10How often data is pushed to the endpoint.
maximumBufferSizeintNo10000Maximum number of events to buffer. Events are dropped when this limit is reached. Range: 5,000–1,000,000.
maximumFlushSizeintNo10000Maximum number of events to send per upload batch. Range: 1,000–1,000,000.
dataPathstringNo"./logship-agent-local-storage"Path for local storage used by the agent.
healthobjectNoHealth reporting configuration.
health.intervaltimespanNo00:00:15How often the agent reports its own health.
registrationobjectNoRegistration configuration for agent authentication.
registration.registrationTokenstringNo""Token used to register the agent with the Logship backend.
{
  "Output": {
    "endpoint": "https://localhost:5000",
    "account": "00000000-0000-0000-0000-000000000000",
    "interval": "00:00:02",
    "maximumBufferSize": 40000,
    "maximumFlushSize": 15000,
    "dataPath": "./logship-agent-local-storage",
    "health": {
      "interval": "00:00:05"
    },
    "registration": {
      "registrationToken": "your-token-here"
    }
  }
}

Logging

Standard .NET logging configuration. See .NET Logging Configuration for more information.

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "System.Net.Http.HttpClient.Default": "Warning"
    }
  }
}

Sources

The Sources section is an object where each key is a source name and each value is that source's configuration. Every source has an enabled field (default: true) that controls whether it is active. Sources that collect on an interval also have an interval field (default: 00:00:15).

DiskInformation

Collects disk and filesystem usage information.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
intervaltimespanNo00:00:15The collection interval.
{
  "DiskInformation": {
    "enabled": true,
    "interval": "00:00:05"
  }
}

SystemInformation

Collects system-level information such as OS version and hardware details.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
intervaltimespanNo00:00:15The collection interval.
{
  "SystemInformation": {
    "enabled": true,
    "interval": "01:00:00"
  }
}

NetworkInformation

Collects network interface statistics.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
intervaltimespanNo00:00:15The collection interval.
{
  "NetworkInformation": {
    "enabled": true,
    "interval": "00:00:15"
  }
}

ProcessInformation

Collects cross-platform process information.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
intervaltimespanNo00:00:15The collection interval.
{
  "ProcessInformation": {
    "enabled": true,
    "interval": "00:00:30"
  }
}

Proc (Linux)

Collects process information by reading /proc. Only works on Linux and requires access to /proc.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
intervaltimespanNo00:00:15The collection interval.
{
  "Proc": {
    "enabled": true,
    "interval": "00:00:05"
  }
}

Proc.OpenFiles (Linux)

Collects open file descriptor information from /proc. Only works on Linux.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
intervaltimespanNo00:00:15The collection interval.
{
  "Proc.OpenFiles": {
    "enabled": true,
    "interval": "00:05:00"
  }
}

Proc.Modules (Linux)

Collects loaded kernel module information from /proc. Only works on Linux.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
intervaltimespanNo00:00:15The collection interval.
{
  "Proc.Modules": {
    "enabled": true,
    "interval": "00:00:05"
  }
}

UDPListener

Listens on a UDP port for JSON-formatted events and forwards them to the Logship database.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
portintNoUDP port to listen on (1–65535).
{
  "UDPListener": {
    "enabled": true,
    "port": 49999
  }
}

UDP packets should be sent as JSON with the following format:

{
  "timestamp": "2024-01-01T00:00:00Z",
  "schema": "my_table",
  "data": { "key": "value" }
}
FieldTypeRequiredDescription
timestampdatetimeNoEvent timestamp. Defaults to current UTC time.
schemastringYesThe output table name in the Logship database.
dataobjectYesYour data object, serialized and forwarded as-is.

HealthChecks

Periodically executes HTTP GET requests to configured endpoints and records the results.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
targetsarrayYesArray of endpoint targets to check.
targets[].endpointstringYesThe endpoint URI.
targets[].intervaltimespanNo00:00:15The interval for this health check.
targets[].includeResponseHeadersboolNofalseInclude response headers in output.
targets[].includeResponseBodyboolNofalseInclude response body in output.
{
  "HealthChecks": {
    "enabled": true,
    "targets": [
      {
        "endpoint": "https://example.com",
        "interval": "00:05:00",
        "includeResponseHeaders": true,
        "includeResponseBody": true
      }
    ]
  }
}

JournalCtl (Linux)

Collects logs from the systemd journal. Only works on Linux systems with journald.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
flagsintNo0Journalctl flags to use when collecting logs.
includeFieldsarrayNo[]Additional journal fields to include in the output.
filtersarrayNo[]Array of filter groups to control which journal entries to collect.

Filters support matchAny (OR logic) and matchAll (AND logic) groupings. Each filter condition can be either a hasField check (field exists) or a fieldEquals check (field matches a specific value).

{
  "JournalCtl": {
    "enabled": true,
    "flags": 0,
    "includeFields": ["USERID"],
    "filters": [
      {
        "matchAny": [
          { "hasField": "CONTAINER_NAME" },
          {
            "fieldEquals": {
              "field": "SYSLOG_IDENTIFIER",
              "value": "systemd-resolved"
            }
          }
        ]
      },
      {
        "matchAll": [
          {
            "fieldEquals": {
              "field": "SYSLOG_IDENTIFIER",
              "value": "kernel"
            }
          }
        ]
      }
    ]
  }
}

SyslogTcp

Listens for syslog messages over TCP.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
endpointstringNo"127.0.0.1"The address to listen on.
portintNo514TCP port to listen on (1–65535).
{
  "SyslogTcp": {
    "enabled": true,
    "port": 5140
  }
}

LogFile

Tails log files using glob patterns. Supports multiline aggregation and JSON lines parsing.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
includearrayYes[]Glob patterns for files to include (e.g. "*.log").
excludearrayNo[]Glob patterns for files to exclude (e.g. "*.tmp").
workingDirectorystringNoBase directory for glob pattern matching.
encodingstringNo"utf-8"File encoding.
startAtBeginningboolNofalseStart reading from the beginning of the file instead of the tail.
ignoreCheckpointsboolNofalseIgnore saved file position checkpoints on startup.
ignoreOlderSecsintNoIgnore files not modified within this many seconds.
globMinimumCooldownMsintNo1000Minimum interval between glob re-evaluations (ms). Min: 100.
readBufferSizeintNo8192File read buffer size in bytes. Min: 1024.
maxLineBytesintNo1048576Maximum line length in bytes. Min: 1024.
multilineobjectNoMultiline aggregation settings.
jsonLinesobjectNoJSON Lines parsing settings.

Multiline configuration:

FieldTypeRequiredDefaultDescription
modestringNo"startPattern"Multiline mode.
startPatternstringNoRegex pattern that marks the start of a new log entry.
conditionPatternstringNoRegex condition pattern for line continuation.
timeoutMsintNo1000Timeout before flushing a multiline block (ms).

JSON Lines configuration:

FieldTypeRequiredDefaultDescription
enabledboolNofalseEnable JSON Lines parsing.
skipInvalidLinesboolNotrueSkip lines that aren't valid JSON.
timestampFieldstringNoJSON field to use as the event timestamp.
messageFieldstringNoJSON field to use as the log message.
{
  "LogFile": {
    "enabled": true,
    "include": ["*.log", "PMS Plugin Logs/*.log"],
    "exclude": ["*.tmp", "*.bak"],
    "workingDirectory": "/var/log/myapp/",
    "encoding": "utf-8",
    "startAtBeginning": false,
    "ignoreOlderSecs": 86400,
    "multiline": {
      "mode": "start_pattern",
      "startPattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}",
      "timeoutMs": 5000
    }
  }
}

Otlp

Receives telemetry data via the OpenTelemetry Protocol (OTLP) over gRPC. Supports logs, metrics, and traces.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
portintNo4317gRPC port to listen on (1–65535).
{
  "Otlp": {
    "enabled": true,
    "port": 4317
  }
}

MQTT

Subscribes to an MQTT broker and collects messages from topics.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
brokerAddressstringNo"localhost"MQTT broker hostname or IP address.
brokerPortintNo1883MQTT broker port (1–65535).
clientIdstringNo"logship-agent"MQTT client identifier.
usernamestringNoUsername for broker authentication.
passwordstringNoPassword for broker authentication.
topicstringNo"#"MQTT topic filter to subscribe to.
useTlsboolNofalseConnect to the broker using TLS.
combinedboolNotrueCombine all topic messages into a single output table.
{
  "MQTT": {
    "enabled": true,
    "brokerAddress": "mqtt.example.com",
    "brokerPort": 1883,
    "clientId": "logship-agent",
    "username": "user",
    "password": "secret",
    "topic": "sensors/#",
    "useTls": true,
    "combined": true
  }
}

NmapScanner

Runs periodic Nmap network scans against configured subnets.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
intervaltimespanNo00:00:15The scan interval.
shellExecboolNofalseUse shell execution for Nmap.
subnetsarrayYesArray of subnet configurations to scan.
subnets[].subnetstringYesSubnet in CIDR notation (e.g. "192.168.0.0/24").
subnets[].nmapArgsstringNo"-T4 -n"Additional Nmap command line arguments.
{
  "NmapScanner": {
    "enabled": true,
    "interval": "00:01:00",
    "subnets": [
      {
        "subnet": "192.168.0.0/24"
      },
      {
        "subnet": "192.168.1.0/24",
        "nmapArgs": "-T4 -n -sV"
      }
    ]
  }
}

Windows.ETW (Windows)

Collects events from Windows Event Tracing for Windows (ETW) providers.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
sessionNamePrefixstringNoPrefix for the ETW session name.
cleanupOldSessionsboolNotrueClean up old ETW sessions before starting a new one.
reuseExistingSessionboolNotrueReuse an existing ETW session with the same configuration.
providersarrayYesArray of ETW providers to collect from.
providers[].providerGuidguidNoGUID of the ETW provider.
providers[].providerNamestringNoName of the ETW provider (alternative to GUID).
providers[].levelstringNo"Informational"Trace event level: Critical, Error, Warning, Informational, Verbose.
providers[].keywordslongNoAllKeyword bitmask to filter events.
{
  "Windows.ETW": {
    "enabled": true,
    "cleanupOldSessions": true,
    "reuseExistingSession": true,
    "providers": [
      {
        "ProviderGuid": "7f006a22-73fb-4c17-b1eb-0a3070f9f187"
      },
      {
        "ProviderGuid": "E6F378E8-21CE-49A9-8D98-1BAAF053AB51"
      }
    ]
  }
}

Windows.PerformanceCounters (Windows)

Collects Windows performance counter data.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
intervaltimespanNo00:00:15The collection interval.
counterRefreshIntervaltimespanNo00:01:00How often to refresh the list of available counters.
countersarrayYesArray of performance counter path patterns to collect.
{
  "Windows.PerformanceCounters": {
    "enabled": true,
    "interval": "00:00:05",
    "counters": [
      "\\Process(*)\\*logship*",
      "\\Process(*)\\Logship.Agent.ConsoleHost"
    ]
  }
}

Internals

Collects internal agent metrics and tracing data for self-monitoring.

FieldTypeRequiredDefaultDescription
enabledboolNotrueEnable this source.
intervaltimespanNo00:00:15The collection interval.
enableMetricsboolNotrueCollect internal agent metrics.
enableTracingboolNotrueCollect internal agent trace data.
{
  "Internals": {
    "enabled": true,
    "interval": "00:00:15",
    "enableMetrics": true,
    "enableTracing": true
  }
}