# Fluentd

This section explains how you can configure 'Fluentd' like a log shipper.

In order for the Fluentd component to send the log details to the event gateway,  users have to configure two elements.

1. Event Gateway Endpoint
2. Fluentd configuration&#x20;

**Step 1:**&#x20;

An example Event Gateway Endpoint configuration is captured in the below configuration snippet

```
Gateway Endpoint:
endpoints:
- name: http_events
  enabled: true
  type: http
  content_type: auto
  port: 516
  attrs:
    site_code: cfx_dc3
    archive_name: http_events
  stream: http-stream-01 
```

An example Fluentd configuration is captured in the below configuration snippet.

**Step 2:**&#x20;

Update host details in /etc/td-agent/td-agent.conf (using your favorite editor (e.g. vi )

```
## CFX Configuration

<source>
  @type tail
  path /var/log/messages
  pos_file /var/log/td-agent/log-messages.pos
  tag cfx-test-log
  <parse>
    @type none
  </parse>
</source>
<match cfx-test-log>
  @type http
  endpoint http://<event-gateway>:516/http_events
  open_timeout 2
  <format>
    @type json
  </format>
  <buffer>
    flush_interval 10s
  </buffer>
</match>
```

**Step 3:**

Restart Fluentd service (example is captured in the below snippet)

```
# Restart td-agent services 
sudo systemctl stop td-agent
sudo systemctl start td-agent
```

Note: In order to run the above commands, the user is expected to have 'sudo' privileges or run the command as a root to enable the required ports.


---

# 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.cloudfabrix.io/rda/installation/log-shippers/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.
