# Commands

Configuration files must be flexible enough for any deployment need, but they must keep a clean and readable format.

Fluent Bit *Commands* extends a configuration file with specific built-in features. The list of commands available as of Fluent Bit 0.12 series are:

| Command                  | Prototype     | Description                  |
| ------------------------ | ------------- | ---------------------------- |
| [@INCLUDE](#cmd_include) | @INCLUDE FILE | Include a configuration file |
| [@SET](#cmd_set)         | @SET KEY=VAL  | Set a configuration variable |

## @INCLUDE Command <a href="#cmd_include" id="cmd_include"></a>

Configuring a logging pipeline might lead to an extensive configuration file. In order to maintain a human-readable configuration, it's suggested to split the configuration in multiple files.

The @INCLUDE command allows the configuration reader to include an external configuration file, e.g:

```
[SERVICE]
    Flush 1

@INCLUDE inputs.conf
@INCLUDE outputs.conf
```

The above example defines the main service configuration file and also include two files to continue the configuration:

### inputs.conf

```
[INPUT]
    Name cpu
    Tag  mycpu

[INPUT]
    Name tail
    Path /var/log/*.log
    Tag  varlog.*
```

### outputs.conf

```
[OUTPUT]
    Name   stdout
    Match  mycpu

[OUTPUT]
    Name            es
    Match           varlog.*
    Host            127.0.0.1
    Port            9200
    Logstash_Format On
```

Note that despites the order of inclusion, Fluent Bit will **ALWAYS** respect the following order:

* Service
* Inputs
* Filters
* Outputs

## @SET Command <a href="#cmd_set" id="cmd_set"></a>

Fluent Bit supports [configuration variables](https://docs.fluentbit.io/manual/3.2/administration/configuring-fluent-bit/classic-mode/variables), one way to expose this variables to Fluent Bit is through setting a Shell environment variable, the other is through the *@SET* command.

The @SET command can only be used at root level of each line, meaning it cannot be used inside a section, e.g:

```
@SET my_input=cpu
@SET my_output=stdout

[SERVICE]
    Flush 1

[INPUT]
    Name ${my_input}

[OUTPUT]
    Name ${my_output}
```


---

# 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.fluentbit.io/manual/3.2/administration/configuring-fluent-bit/classic-mode/commands.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.
