---
title: InfluxDB Logs
slug: telemetry-pipeline/influxdb-logs
docTags: 
createdAt: 2025-04-21T01:01:00.483Z
---

&#x20;InfluxDB Logs Sink

## Overview

The **InfluxDB Logs sink** enables worker to deliver **log event data** into **InfluxDB**. It supports both **InfluxDB v2.x** (bucket + org + token) and legacy **InfluxDB v0.x/v1.x** (database + optional retention policy and username/password authentication).

This sink is useful when you want to store logs in InfluxDB for correlation with time-series telemetry and querying with InfluxDB’s native tooling.

## Supported Input Types

- Logs&#x20;

## Prerequisites

Ensure the following prerequisites are satisfied before using this sink:

- A reachable InfluxDB endpoint over HTTP or HTTPS&#x20;
- Appropriate credentials depending on your InfluxDB version:&#x20;
  - **InfluxDB v2.x+**: token authentication and organization access&#x20;
  - **InfluxDB v0.x/v1.x**: database access, optionally username/password&#x20;
- The target destination exists:&#x20;
  - **v2.x+**: bucket exists in the specified organization&#x20;
  - **v0.x/v1.x**: database exists, and retention policy exists if specified&#x20;

## Core Configuration Parameters

### Endpoint

Defines the target InfluxDB HTTP endpoint where worker sends log data.

The endpoint must be a full HTTP URI including scheme, host, and port.

### InfluxDB v2.x Parameters

Use these parameters when writing to InfluxDB **v2.x and above**:

Bucket

Specifies the bucket where log data will be written.

Organization

Specifies the organization that owns the target bucket.

Token

The authentication token used to write data into the organization and bucket.

### InfluxDB v0.x/v1.x Parameters

Use these parameters when writing to InfluxDB **v0.x/v1.x**:

Database

Specifies the database where log data will be written.

Retention Policy Name

Optionally targets a specific retention policy for writes.
&#x20;This is useful when different retention periods are configured at the database level.

Consistency

Optionally sets the write consistency level for the target cluster.
&#x20;This only applies to legacy InfluxDB versions where consistency levels are configurable.

Username and Password

Optional credentials for basic authentication when required by the InfluxDB deployment.

## Measurement Mapping

### Measurement

Controls the InfluxDB measurement name that receives the log entries.

This is important for organizing log streams and supporting predictable queries and retention strategies.

### Namespace

This field is deprecated and should not be used for new deployments.
&#x20;Use **measurement** instead.

## Log Schema Field Mapping

### Host Key

Controls which event field is treated as the hostname.
&#x20;If not set explicitly, worker uses the configured log\_schema.host\_key value (commonly host).

### Message Key

Controls which event field is treated as the log message payload.
&#x20;If not set explicitly, worker uses the configured log\_schema.message\_key value (commonly message).

### Source Type Key

Controls which event field is treated as the source type.
&#x20;If not set explicitly, worker uses the configured log\_schema.source\_type\_key value (commonly source\_type).

These mappings allow you to align worker's events with your existing log conventions without restructuring upstream data producers.

## Tagging Strategy

### Tags

Defines which log fields are promoted into **InfluxDB tags**.

Tags are indexed and are typically used for dimensions such as:

- host&#x20;
- service name&#x20;
- namespace&#x20;
- environment&#x20;
- region&#x20;
- source type&#x20;

Because tags influence index cardinality, you should choose tag fields carefully to avoid excessive cardinality growth.

By default, worker adds:

- metric\_type&#x20;
- the configured host key field&#x20;
- the configured source type key field&#x20;

## Event Serialization Controls

### Encoding

The sink supports selective serialization controls via:

- Including only specific fields&#x20;
- Excluding specific fields&#x20;
- Timestamp format control&#x20;

This is useful for:

- Reducing payload size&#x20;
- Ensuring consistent timestamp representation&#x20;
- Removing noisy fields before persistence&#x20;

## Request Behavior Controls

### Request Tuning

The sink exposes outbound request tuning options to control behavior under load, including:

- Concurrency controls&#x20;
- Rate limits&#x20;
- Retry strategy and retry timing&#x20;
- Request timeouts&#x20;

These settings are typically used to align the sink’s sending behavior with InfluxDB’s ingestion capacity and to protect the pipeline during transient failures.

## TLS Configuration

### TLS

TLS options control secure transport to the InfluxDB endpoint, including:

- Custom CA trust configuration&#x20;
- Client certificate authentication (mTLS) if required&#x20;
- Hostname and certificate verification behavior&#x20;

TLS should be used for production deployments, especially when sending data across networks you do not fully control.

## Typical Use Cases

Common scenarios for the InfluxDB Logs sink include:

- Storing logs alongside time-series metrics in InfluxDB for unified querying&#x20;
- Enabling infrastructure-level correlation between logs and telemetry&#x20;
- Long-term retention of structured logs using InfluxDB retention and bucket policies&#x20;
- Lightweight log persistence for edge deployments already standardized on InfluxDB&#x20;

## Summary

The **InfluxDB Logs sink** provides a direct path for delivering worker log events into InfluxDB. It supports both modern (v2.x+) and legacy (v0.x/v1.x) deployments, allows flexible mapping of message/host/source fields, supports tagging for efficient querying, and includes fine-grained controls for request behavior and TLS security.
