Skip to main content

Agent Configuration

The Logstag agent uses a TOML configuration file. The file has one global [agent] section and one [targets.name] section for each monitored database target.

Use the service URL and API key provided for your Logstag organization. Shared examples should use masked URLs and placeholder credentials.

Configuration Structure

[agent]
# Global agent settings

[targets.production-db]
# Database target settings

Each target name must be unique in the configuration file. Use stable names that identify the environment and target clearly, such as production-postgres or analytics-mssql.

Agent Section

[agent]
api_base_url = "https://<logstag-agent-api-base-url>"
api_key = "<your-logstag-agent-api-key>"
log_level = "info"

high_frequency_interval = 10 # 10 seconds
medium_frequency_interval = 60 # 1 minute
low_frequency_interval = 600 # 10 minutes
schema_frequency_interval = 14400 # 240 minutes
FieldRequiredDefaultDescription
api_base_urlYesNoneLogstag agent service URL for your organization.
api_keyYesNoneAPI key used to authenticate the agent.
log_levelNoinfoLogging level. Common values are debug, info, warn, and error.
high_frequency_intervalNo10 secondsRuntime activity and high-frequency operational signals.
medium_frequency_intervalNo1 minuteWorkload, query, replication, and similar operational signals.
low_frequency_intervalNo10 minutesConfiguration and less frequently changing operational data.
schema_frequency_intervalNo240 minutesSchema, index, and other heavier metadata collection.

Intervals are configured as seconds in TOML. Setting an interval to 0 disables that collection tier. Disable tiers only when you understand which product areas depend on them.

Optional Agent Settings

FieldDefaultDescription
startup_warmup_delay0 secondsDelay before monitoring starts after agent startup.
compress_request_payloadtrueCompress outbound monitoring payloads.
update_check_enabledtrueAllow the agent to check for available updates.
update_channelmainRelease channel used for update checks. Use the production channel unless Logstag support instructs otherwise.
update_check_interval1440 minutesInterval between update checks.
auto_install_updatestrueAllow automatic installation of available updates.
export_to_filefalseDebug-only payload export. Keep disabled in production unless Logstag support directs otherwise.
export_pathCurrent directoryDirectory used when debug payload export is enabled.
mock_modefalseLocal development mode that disables normal Logstag submission.

Debug payload export can contain operational metadata, query text, object names, or security posture information depending on the enabled engines. Treat exported files as sensitive.

Target Section

[targets.production-postgres]
platform = "self-hosted"
db_engine = "postgresql"
db_host = "postgres.example.internal"
db_port = 5432
db_username = "logstag_monitor"
db_password = "<your-database-password>"
db_name = "postgres"
FieldRequiredDescription
platformYesTarget platform, such as self-hosted, aws-rds, or huawei-rds.
db_engineYesDatabase engine identifier.
db_hostYesDatabase hostname or IP address reachable from the agent host.
db_portYesDatabase listener port.
db_usernameYesDedicated monitoring user.
db_passwordYesMonitoring user password. Empty values are valid only where the engine and deployment intentionally allow unauthenticated access.
db_nameYesDatabase name, Redis/Valkey database number, or Oracle service/PDB identifier depending on the engine.

Use a dedicated monitoring identity for each target instead of personal administrator accounts or application users.

Engine Values

The db_engine value must be lowercase.

Enginedb_engine valueDefault Port
PostgreSQLpostgresql5432
Microsoft SQL Servermssql1433
MongoDBmongodb27017
Redisredis6379
Valkeyvalkey6379
Oracleoracle1521

Engine-specific behavior:

  • PostgreSQL, Microsoft SQL Server, MongoDB, and Oracle use db_name as the target database, service, or PDB identifier.
  • Redis and Valkey use db_name as the database number string, such as "0".
  • MongoDB and Redis/Valkey can technically be configured with empty credentials only when the target deployment intentionally allows unauthenticated access. Production deployments should use authentication.
  • Current Oracle connectivity does not require Oracle Instant Client for standard monitoring.

Platform Values

Platformplatform valueNotes
Self-hostedself-hostedStandard deployment for customer-managed database targets.
AWS RDSaws-rdsRequires cloud metadata and cloud credentials when cloud metrics are enabled.
Huawei Cloud RDShuawei-rdsRequires cloud metadata, cloud credentials, and project ID when cloud metrics are enabled.

Use only the managed platform values listed here unless Logstag support confirms another value for your environment.

Managed Platform Fields

Managed targets can require additional cloud metadata and credentials.

FieldRequired whenDescription
cloud_regionManaged platformCloud region.
cloud_instance_idManaged platformCloud database instance identifier.
cloud_access_keyManaged platformCloud access key.
cloud_secret_keyManaged platformCloud secret key.
cloud_project_idHuawei Cloud RDSHuawei project ID.

Cloud access should be scoped to the metrics required by the managed platform integration. Store cloud secrets using encrypted local values where available.

Sensitive Values

The agent supports encrypted local values for sensitive fields:

  • api_key
  • db_password
  • cloud_secret_key

Encrypted values are machine-specific and should be generated on the host that runs the agent. Copying encrypted values between hosts will not produce a portable secret.

Use plain text values only for local testing or controlled troubleshooting. Production configurations should use encrypted local values where available and should be readable only by the agent service account and administrators.

Multiple Targets

A single agent configuration can define multiple targets:

[targets.production-postgres]
platform = "self-hosted"
db_engine = "postgresql"
db_host = "postgres.example.internal"
db_port = 5432
db_username = "logstag_monitor"
db_password = "<postgres-monitor-password>"
db_name = "postgres"

[targets.analytics-redis]
platform = "self-hosted"
db_engine = "redis"
db_host = "redis.example.internal"
db_port = 6379
db_username = "logstag_monitor"
db_password = "<redis-monitor-password>"
db_name = "0"

Configure only targets that the agent host can reach. If targets live in separate network zones, deploy separate agents closer to those databases.

Validate Configuration

Validate the configuration before starting or restarting the service.

Linux:

/opt/logstag-agent/bin/logstag-agent --check-config
sudo systemctl restart logstag-agent

Windows:

& "C:\Program Files\Logstag Agent\bin\logstag-agent.exe" --check-config
Restart-Service "Logstag Agent"

After restart, check the agent logs for configuration, authentication, connectivity, and permission errors.

Configuration Guidance

  • Keep production API keys, passwords, and cloud secrets out of tickets, screenshots, and shared documentation.
  • Use one dedicated monitoring user per engine or target group.
  • Keep target names stable; changing names may affect how operators recognize assets.
  • Keep debug payload export disabled in production unless Logstag support directs otherwise.
  • Prefer the default intervals unless there is a specific operational reason to tune them.
  • Use engine setup pages to prepare database permissions before expecting full product coverage.