Movatterモバイル変換


[0]ホーム

URL:


Loading

Webhdfs output plugin

For other versions, see theVersioned plugin docs.

For questions about the plugin, open a topic in theDiscuss forums. For bugs or feature requests, open an issue inGithub. For the list of Elastic supported plugins, please consult theElastic Support Matrix.

This plugin sends Logstash events into files in HDFS via thewebhdfs REST API.

This plugin has no dependency on jars from hadoop, thus reducing configuration and compatibility problems. It uses the webhdfs gem from Kazuki Ohta and TAGOMORI Satoshi (@see:https://github.com/kzk/webhdfs). Optional dependencies are zlib and snappy gem if you use the compression functionality.

If you get an error like:

Max write retries reached. Exception: initialize: name or service not known {:level=>:error}

make sure that the hostname of your namenode is resolvable on the host running Logstash. When creating/appending to a file, webhdfs somtime sends a307 TEMPORARY_REDIRECT with theHOSTNAME of the machine its running on.

This is an example of Logstash config:

input {  ...}filter {  ...}output {  webhdfs {    host => "127.0.0.1"    port => 50070    path => "/user/logstash/dt=%{+YYYY-MM-dd}/logstash-%{+HH}.log"    user => "hue"  }}
  1. (required)
  2. (optional, default: 50070)
  3. (required)
  4. (required)

This plugin supports the following configuration options plus theCommon options described later.

Also seeCommon options for a list of options supported by all output plugins.

  • Value can be any of:none,snappy,gzip
  • Default value is"none"

Compress output. One of [none,snappy,gzip]

  • Value type isnumber
  • Default value is500

Sending data to webhdfs if event count is above, even ifstore_interval_in_secs is not reached.

  • This is a required setting.
  • Value type isstring
  • There is no default value for this setting.

The server name for webhdfs/httpfs connections.

  • Value type isnumber
  • Default value is1

Sending data to webhdfs in x seconds intervals.

  • Value type isstring
  • There is no default value for this setting.

Set kerberos keytab file. Note that the gssapi library needs to be available to use this.

  • Value type isnumber
  • Default value is30

WebHdfs open timeout, default 30s.

  • This is a required setting.
  • Value type isstring
  • There is no default value for this setting.

The path to the file to write to. Event fields can be used here, as well as date fields in the joda time format, e.g.:/user/logstash/dt=%{+YYYY-MM-dd}/%{@source_host}-%{+HH}.log

  • Value type isnumber
  • Default value is50070

The server port for webhdfs/httpfs connections.

  • Value type isnumber
  • Default value is30

The WebHdfs read timeout, default 30s.

  • Value type isnumber
  • Default value is0.5

How long should we wait between retries.

  • Value type isboolean
  • Default value istrue

Retry some known webhdfs errors. These may be caused by race conditions when appending to same file, etc.

  • Value type isnumber
  • Default value is5

How many times should we retry. If retry_times is exceeded, an error will be logged and the event will be discarded.

  • Value type isboolean
  • Default value isfalse

Avoid appending to same file in multiple threads. This solves some problems with multiple logstash output threads and locked file leases in webhdfs. If this option is set to true, %{[@metadata][thread_id]} needs to be used in path config settting.

  • Value type isnumber
  • Default value is32768

Set snappy chunksize. Only neccessary for stream format. Defaults to 32k. Max is 65536 @seehttp://code.google.com/p/snappy/source/browse/trunk/framing_format.txt

  • Value can be any of:stream,file
  • Default value is"stream"

Set snappy format. One of "stream", "file". Set to stream to be hive compatible.

  • Value type isstring
  • There is no default value for this setting.

Set ssl cert file.

  • Value type isstring
  • There is no default value for this setting.

Set ssl key file.

  • Value type isstring
  • Default value isfalse

Standby namenode for ha hdfs.

  • Value type isnumber
  • Default value is50070

Standby namenode port for ha hdfs.

  • Value type isboolean
  • Default value isfalse

Use httpfs mode if set to true, else webhdfs.

  • Value type isboolean
  • Default value isfalse

Set kerberos authentication.

  • Value type isboolean
  • Default value isfalse

Set ssl authentication. Note that the openssl library needs to be available to use this.

  • This is a required setting.
  • Value type isstring
  • There is no default value for this setting.

The Username for webhdfs.

These configuration options are supported by all output plugins:

SettingInput typeRequired
codeccodecNo
enable_metricbooleanNo
idstringNo
  • Value type iscodec
  • Default value is"line"

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.

  • Value type isboolean
  • Default value istrue

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.

  • Value type isstring
  • There is no default value for this setting.

Add a uniqueID 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 webhdfs outputs. Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs.

output {  webhdfs {    id => "my_plugin_id"  }}
Note

Variable substitution in theid field only supports environment variables and does not support the use of values from the secret store.

Welcome to the docs for thelatest Elastic product versions, including Elastic Stack 9.0 and Elastic Cloud Serverless.To view previous versions, go toelastic.co/guide.


[8]ページ先頭

©2009-2025 Movatter.jp