# Parser Plugins

Fluentd has nine (9) types of plugins:

* [Input](/input.md)
* [Parser](/parser.md)
* [Filter](/filter.md)
* [Output](/output.md)
* [Formatter](/formatter.md)
* [Storage](/storage.md)
* [Service Discovery](/service_discovery.md)
* [Buffer](/buffer.md)
* [Metrics](/metrics.md)

This article gives an overview of the Parser Plugin.

## Overview

Sometimes, the `<parse>` directive for input plugins (e.g. [`in_tail`](/input/tail.md), [`in_syslog`](/input/syslog.md), [`in_tcp`](/input/tcp.md) and [`in_udp`](/input/udp.md)) cannot parse the user's custom data format (for example, a context-dependent grammar that can't be parsed with a regular expression). To address such cases, Fluentd has a pluggable system that enables the user to create their own parser formats.

## How To Use

* Write a custom format plugin. See [here](/plugin-development/api-plugin-parser.md)

  for more information.
* From any input plugin that supports the `<parse>` directive, call the custom

  plugin by its name.

Here is an example to read Nginx access logs using `in_tail` and `parser_nginx`:

```
<source>
  @type tail
  path /path/to/input/file
  <parse>
    @type nginx
    keep_time_key true
  </parse>
</source>
```

**Note**: When `td-agent` is launched by systemd, the default user of the `td-agent` process is the `td-agent` user. You must ensure that this user has read permission to the tailed `/path/to/file`. For instance, on Ubuntu, the default Nginx access file `/var/log/nginx/access.log` is mode `0640` and owned by `www-data:adm`. In this case, several options are available to allow read access:

1. Add the `td-agent` user to the `adm` group, e.g. through `usermod -aG`, or
2. Use the [`cap_dac_read_search` capability](/deployment/linux-capability.md#capability-handling-on-in_tail) to allow the invoking user to read the file without otherwise changing its permission bits or ownership.

## List of Built-in Parsers

* [`regexp`](/parser/regexp.md)
* [`apache2`](/parser/apache2.md)
* [`apache_error`](/parser/apache_error.md)
* [`nginx`](/parser/nginx.md)
* [`syslog`](/parser/syslog.md)
* [`csv`](/parser/csv.md)
* [`tsv`](/parser/tsv.md)
* [`ltsv`](/parser/ltsv.md)
* [`json`](/parser/json.md)
* [`msgpack`](/parser/msgpack.md)
* [`multiline`](/parser/multiline.md)
* [`none`](/parser/none.md)

### Third-party Parsers

* [`grok`](https://github.com/fluent/fluent-plugin-grok-parser)

  If you are familiar with `grok` patterns, `grok-parser` plugin is useful. Use `> 1.0.0` versions for `fluentd` v0.14/v1.0.
* [`multi-format-parser`](https://github.com/repeatedly/fluent-plugin-multi-format-parser)

  If you need to parse multiple formats in one data stream, `multi-format-parser` is useful.
* [`protobuf`](https://github.com/fluent-plugins-nursery/fluent-plugin-parser-protobuf)

  For protocol buffers.
* [`avro`](https://github.com/fluent-plugins-nursery/fluent-plugin-parser-avro)

  For Apache Avro.

## List of Core Input Plugins with Parser support

Following plugins support `<parse>` directive:

* [`in_tail`](/input/tail.md)
* [`in_tcp`](/input/tcp.md)
* [`in_udp`](/input/udp.md)
* [`in_syslog`](/input/syslog.md)
* [`in_http`](/input/http.md)

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/parser.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.
