# Fluentd

### Image Configuration

We can define our custom fluentd image configuration.

```yaml
  image: fluent/fluentd-kubernetes-daemonset:v1-debian-elasticsearch
  imagePullPolicy: "IfNotPresent"
```

### Elasticsearch Configuration

Elasticsearch connection details information should be defined under the elasticsearch object.

```yaml
  elasticsearch:
    host: "elasticsearch-cluster-ingestion"
    username: elastic
    password: "Opstree@1234"
    tlsEnabled: true
```

### Log Prefix

Log prefix information to append the Kubernetes meta information in the fluentd index in elasticsearch.

```yaml
logPrefix: namespace # namespace or podName
# index will be created like kubernetes-<namespace>
```

### Resources

Resources footprint can be defined under the resource object.

```yaml
  resources:
    requests:
      cpu: 100m
      memory: 200Mi
    limits:
      cpu: 100m
      memory: 200Mi
```

### Custom Configuration

Custom fluentd configuration for log parsing and aggregation.

```yaml
  customConfiguration:
    kubelet.conf: |-
      <source>
        @type systemd
        @id in_systemd_kubelet
        matches [{ "_SYSTEMD_UNIT": "kubelet.service" }]
        <storage>
          @type local
          persistent true
          path /var/log/fluentd-journald-kubelet-cursor.json
        </storage>
        <entry>
          fields_strip_underscores true
        </entry>
        read_from_head true
        tag kubelet
      </source>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.opstreelabs.in/logging-operator/configuration/fluentd.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
