﻿---
title: Gelf output plugin
description: Plugin version: v3.1.7 (Other versions), Released on: 2018-04-06, Changelog. For questions about the plugin, open a topic in the Discuss forums. For bugs...
url: https://docs-v3-preview.elastic.dev/elastic/logstash-docs-md/tree/main/lsr/plugins-outputs-gelf
---

# Gelf output plugin
- Plugin version: v3.1.7 ([Other versions](https://docs-v3-preview.elastic.dev/elastic/logstash-docs-md/tree/main/vpr/output-gelf-index))
- Released on: 2018-04-06
- [Changelog](https://github.com/logstash-plugins/logstash-output-gelf/blob/v3.1.7/CHANGELOG.md)


## Getting help

For questions about the plugin, open a topic in the [Discuss](http://discuss.elastic.co) forums. For bugs or feature requests, open an issue in [Github](https://github.com/logstash-plugins/logstash-output-gelf). For the list of Elastic supported plugins, please consult the [Elastic Support Matrix](https://www.elastic.co/support/matrix#matrix_logstash_plugins).

## Description

This output generates messages in GELF format. This is most useful if you want to use Logstash to output events to Graylog2.
More information at [The Graylog2 GELF specs page](http://docs.graylog.org/en/2.3/pages/gelf.html#gelf-payload-specification)

## Gelf Output Configuration Options

This plugin supports the following configuration options plus the [Common options](#plugins-outputs-gelf-common-options) described later.

| Setting                                                                     | Input type                                                                    | Required |
|-----------------------------------------------------------------------------|-------------------------------------------------------------------------------|----------|
| [`chunksize`](#plugins-outputs-gelf-chunksize)`chunksize`                   | [number](/elastic/logstash-docs-md/tree/main/lsr/value-types#number)number    | No       |
| [`custom_fields`](#plugins-outputs-gelf-custom_fields)`custom_fields`       | [hash](/elastic/logstash-docs-md/tree/main/lsr/value-types#hash)hash          | No       |
| [`full_message`](#plugins-outputs-gelf-full_message)`full_message`          | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string    | No       |
| [`host`](#plugins-outputs-gelf-host)`host`                                  | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string    | Yes      |
| [`ignore_metadata`](#plugins-outputs-gelf-ignore_metadata)`ignore_metadata` | [array](/elastic/logstash-docs-md/tree/main/lsr/value-types#array)array       | No       |
| [`level`](#plugins-outputs-gelf-level)`level`                               | [array](/elastic/logstash-docs-md/tree/main/lsr/value-types#array)array       | No       |
| [`port`](#plugins-outputs-gelf-port)`port`                                  | [number](/elastic/logstash-docs-md/tree/main/lsr/value-types#number)number    | No       |
| [`protocol`](#plugins-outputs-gelf-protocol)`protocol`                      | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string    | No       |
| [`sender`](#plugins-outputs-gelf-sender)`sender`                            | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string    | No       |
| [`ship_metadata`](#plugins-outputs-gelf-ship_metadata)`ship_metadata`       | [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)boolean | No       |
| [`ship_tags`](#plugins-outputs-gelf-ship_tags)`ship_tags`                   | [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)boolean | No       |
| [`short_message`](#plugins-outputs-gelf-short_message)`short_message`       | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string    | No       |

Also see [Common options](#plugins-outputs-gelf-common-options) for a list of options supported by all output plugins.

### `chunksize`

- Value type is [number](/elastic/logstash-docs-md/tree/main/lsr/value-types#number)
- Default value is `1420`

The chunksize. You usually don’t need to change this.

### `custom_fields`

- Value type is [hash](/elastic/logstash-docs-md/tree/main/lsr/value-types#hash)
- Default value is `{}`

The GELF custom field mappings. GELF supports arbitrary attributes as custom fields. This exposes that. Exclude the `_` portion of the field name e.g. `custom_fields => ['foo_field', 'some_value']` sets `_foo_field` = `some_value`.

### `full_message`

- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- Default value is `"%{message}"`

The GELF full message. Dynamic values like `%{foo}` are permitted here.

### `host`

- This is a required setting.
- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- There is no default value for this setting.

Graylog2 server IP address or hostname.

### `ignore_metadata`

- Value type is [array](/elastic/logstash-docs-md/tree/main/lsr/value-types#array)
- Default value is `["@timestamp", "@version", "severity", "host", "source_host", "source_path", "short_message"]`

Ignore these fields when `ship_metadata` is set. Typically this lists the fields used in dynamic values for GELF fields.

### `level`

- Value type is [array](/elastic/logstash-docs-md/tree/main/lsr/value-types#array)
- Default value is `["%{severity}", "INFO"]`

The GELF message level. Dynamic values like `%{level}` are permitted here; useful if you want to parse the *log level* from an event and use that as the GELF level/severity.
Values here can be integers [0..7] inclusive or any of "debug", "info", "warn", "error", "fatal" (case insensitive). Single-character versions of these are also valid, "d", "i", "w", "e", "f", "u" The following additional severity\_labels from Logstash’s syslog\_pri filter are accepted: "emergency", "alert", "critical", "warning", "notice", and "informational".

### `port`

- Value type is [number](/elastic/logstash-docs-md/tree/main/lsr/value-types#number)
- Default value is `12201`

Graylog2 server port number.

### `protocol`

By default, this plugin outputs via the UDP transfer protocol, but can be configured to use TCP instead.
- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- Default value is `"UDP"`

Values here can be either "TCP" or "UDP".

### `sender`

- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- Default value is `"%{host}"`

Allow overriding of the GELF `sender` field. This is useful if you want to use something other than the event’s source host as the "sender" of an event. A common case for this is using the application name instead of the hostname.

### `ship_metadata`

- Value type is [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)
- Default value is `true`

Should Logstash ship metadata within event object? This will cause Logstash to ship any fields in the event (such as those created by grok) in the GELF messages. These will be sent as underscored "additional fields".

### `ship_tags`

- Value type is [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)
- Default value is `true`

Ship tags within events. This will cause Logstash to ship the tags of an event as the field `_tags`.

### `short_message`

- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- Default value is `"short_message"`

The GELF short message field name. If the field does not exist or is empty, the event message is taken instead.

## Common options

These configuration options are supported by all output plugins:

| Setting                                                               | Input type                                                                    | Required |
|-----------------------------------------------------------------------|-------------------------------------------------------------------------------|----------|
| [`codec`](#plugins-outputs-gelf-codec)`codec`                         | [codec](/elastic/logstash-docs-md/tree/main/lsr/value-types#codec)codec       | No       |
| [`enable_metric`](#plugins-outputs-gelf-enable_metric)`enable_metric` | [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)boolean | No       |
| [`id`](#plugins-outputs-gelf-id)`id`                                  | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string    | No       |


### `codec`

- Value type is [codec](/elastic/logstash-docs-md/tree/main/lsr/value-types#codec)
- Default value is `"plain"`

The codec used for output data. Output codecs are a convenient method for encoding your data before it leaves the output without needing a separate filter in your Logstash pipeline.

### `enable_metric`

- Value type is [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)
- Default value is `true`

Disable or enable metric logging for this specific plugin instance. By default we record all the metrics we can, but you can disable metrics collection for a specific plugin.

### `id`

- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- There is no default value for this setting.

Add a unique `ID` to the plugin configuration. If no ID is specified, Logstash will generate one. It is strongly recommended to set this ID in your configuration. This is particularly useful when you have two or more plugins of the same type. For example, if you have 2 gelf outputs. Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs.
```
output {
  gelf {
    id => "my_plugin_id"
  }
}
```