# Post Installation Guide

This article discusses the post-installation steps for new Fluentd users assuming that Fluentd has been installed using the `fluent-package`, `td-agent` and `calyptia-fluentd` package.

## System Administration

### For `fluent-package`

#### Configuration File

After successful installation, a `fluent-package` instance will be up and running with a predefined template configuration file.

The default path for this configuration file is:

```
/etc/fluent/fluentd.conf
```

You may edit this configuration file according to your own use case.

After editing the configuration file, restart `fluentd` using `systemctl` command:

```
$ sudo systemctl restart fluentd
```

#### Logging

By default, Fluentd writes its operation logs to the following file:

```
/var/log/fluent/fluentd.log
```

For more verbose logs, read the article on [Troubleshooting](https://docs.fluentd.org/deployment/trouble-shooting).

### For `td-agent`

{% hint style="danger" %}
As td-agent had reached EOL, SHOULD NOT use td-agent anymore.

Recommend to [Upgrade to fluent-package v5](https://www.fluentd.org/blog/upgrade-td-agent-v4-to-v5).
{% endhint %}

#### Configuration File

After successful installation, a `td-agent` instance will be up and running with a predefined template configuration file.

The default path for this configuration file is:

```
/etc/td-agent/td-agent.conf
```

You may edit this configuration file according to your own use case.

After editing the configuration file, restart `td-agent` using `systemctl` command:

```
$ sudo systemctl restart td-agent
```

#### Logging

By default, `td-agent` writes its operation logs to the following file:

```
/var/log/td-agent/td-agent.log
```

For more verbose logs, read the article on [Troubleshooting](https://docs.fluentd.org/deployment/trouble-shooting).

### For `calyptia-fluentd`

#### Configuration File

After the successful installation, a `calyptia-fluentd` instance will be up and running with a predefined template configuration file.

The default path for this configuration file is:

```
/etc/calyptia-fluentd/calyptia-fluentd.conf
```

You may edit this configuration file according to your own use case.

After editing the configuration file, restart `calyptia-fluentd` using `systemctl` command:

```
$ sudo systemctl restart calyptia-fluentd
```

#### Logging

By default, `calyptia-fluentd` writes its operation logs to the following file:

```
/var/log/calyptia-fluentd/calyptia-fluentd.log
```

For more verbose logs, read the article on [Troubleshooting](https://docs.fluentd.org/deployment/trouble-shooting).

## Connect to the Other Services

### How It Works

In Fluentd, the most important part of data input/output is managed by plugins. Each plugin knows how to interface with an external endpoint and is solely responsible for managing one pipeline to forward data streams.

Plugins use a certain naming convention. For example, if it receives data and interfaces with Apache Kafka, it is called `in_kafka`. In the same way, if it publishes data and connects to MongoDB, it is called `out_mongo`.

The following configuration uses the `in_forward` plugin as an input source and `out_file` plugin as an output endpoint:

```
<source>
  @type forward
  port 9999
</source>
<match app.**>
  @type file
  path /var/log/app/data.log
  compress gzip
</match>
```

### Plugin Management

Fluentd manages plugins as Ruby gems but stores them in their dedicated directory separated from the normal Ruby gems.

#### `fluent-package`

A special program `fluent-gem` is used to manage plugin gems. For example, the following command installs a plugin to connect to S3 (including both `in_s3` and `out_s3` plugins):

```
 $ sudo fluent-gem install fluent-plugin-s3
```

#### `td-agent`

{% hint style="danger" %}
As td-agent had reached EOL, SHOULD NOT use td-agent anymore.

Recommend to [Upgrade to fluent-package v5](https://www.fluentd.org/blog/upgrade-td-agent-v4-to-v5).
{% endhint %}

A special program `td-agent-gem` is used to manage plugin gems. For example, the following command installs a plugin to connect to S3 (including both `in_s3` and `out_s3` plugins):

```
 $ sudo /usr/sbin/td-agent-gem install fluent-plugin-s3
```

#### `calyptia-fluentd`

A special program `calyptia-fluentd-gem` is used to manage plugin gems. For example, the following command installs a plugin to connect to S3 (including both `in_s3` and `out_s3` plugins):

```
 $ sudo /usr/sbin/calyptia-fluentd-gem install fluent-plugin-s3
```

### Available Plugins

See the [List Of All Plugins](https://www.fluentd.org/plugins) to explore the available third-party plugins.

Note that a number of plugins are bundled with the standard distribution of `td-agent` so you do not need to install them manually.

## Configuration Syntax

### Data Source

A configuration file consists of a number of setting blocks or sections e.g. `<source>`. Each block contains a set of options for a specific data endpoint.

For example, if you want to create an endpoint to receive data from [syslog](https://docs.fluentd.org/input/syslog), you need to add a `<source>` block and set up its settings like this:

```
<source>
  @type syslog
  port 5140
  tag system
</source>
```

The `@type` parameter specifies which plugin to use. Note that the plugin type prefix i.e. `in_`, `out_`, etc. is not needed here. In this example, the input plugin is specified as `syslog`, not `in_syslog`.

### Output Endpoint

To add an output endpoint for the data stream, you need to define a `<match>` block. Syntactically, `<match>` is slightly different from `<source>` in the sense that it requires a filter expression as an argument.

For example, if you want to output events tagged with `debug.log`, you need to mention this tag as an argument in `<match>` like this:

```
<match debug.log>
  @type kafka2
  port 5140
  brokers kafka-server:9092
  tag system
  # ...
</match>
```

The wildcard character `*` can be used in the filter expression. For example, `debug.*` matches `debug.log`, `debug.foo`, etc.

To catch all the descendent tags, use double asterisks `**`. For example, `debug.**` matches not only `debug.log`, but also `debug.log.bar` or `debug.log.level.critical`, etc.

### Further Reading

* [Configuration File Syntax](https://docs.fluentd.org/configuration/config-file)

If this article is incorrect or outdated, or omits critical information, please [let us know](https://github.com/fluent/fluentd-docs-gitbook/issues?state=open). [Fluentd](http://www.fluentd.org/) is an open-source project under [Cloud Native Computing Foundation (CNCF)](https://cncf.io/). All components are available under the Apache 2 License.


---

# 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.fluentd.org/installation/post-installation-guide.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.
