<!DOCTYPE html>
<html lang="en-us">
  <head>
    
<meta charset="UTF-8">
<title>How to write a Java output plugin | Logstash Reference [8.6] | Elastic</title>
<meta class="elastic" name="content" content="How to write a Java output plugin | Logstash Reference [8.6]">

<link rel="home" href="index.html" title="Logstash Reference [8.6]"/>
<link rel="up" href="contributing-java-plugin.html" title="Contributing a Java Plugin"/>
<link rel="prev" href="java-filter-plugin.html" title="How to write a Java filter plugin"/>
<link rel="next" href="glossary.html" title="Glossary of Terms"/>
<meta class="elastic" name="product_version" content="8.6"/>
<meta class="elastic" name="product_name" content="Logstash"/>
<meta class="elastic" name="website_area" content="documentation"/>
<meta name="DC.type" content="Learn/Docs/Logstash/Reference/8.6"/>
<meta name="DC.subject" content="Logstash"/>
<meta name="DC.identifier" content="8.6"/>
<meta name="robots" content="noindex,nofollow"/>

    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://cdn.optimizely.com/js/18132920325.js"></script>
    <link rel="apple-touch-icon" sizes="57x57" href="/https/raw.githubusercontent.com/apple-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/https/raw.githubusercontent.com/apple-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/https/raw.githubusercontent.com/apple-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/https/raw.githubusercontent.com/apple-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/https/raw.githubusercontent.com/apple-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/https/raw.githubusercontent.com/apple-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/https/raw.githubusercontent.com/apple-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/https/raw.githubusercontent.com/apple-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/https/raw.githubusercontent.com/apple-icon-180x180.png">
    <link rel="icon" type="image/png" href="/https/raw.githubusercontent.com/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="/https/raw.githubusercontent.com/android-chrome-192x192.png" sizes="192x192">
    <link rel="icon" type="image/png" href="/https/raw.githubusercontent.com/favicon-96x96.png" sizes="96x96">
    <link rel="icon" type="image/png" href="/https/raw.githubusercontent.com/favicon-16x16.png" sizes="16x16">
    <link rel="manifest" href="/https/raw.githubusercontent.com/manifest.json">
    <meta name="apple-mobile-web-app-title" content="Elastic">
    <meta name="application-name" content="Elastic">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="/mstile-144x144.png">
    <meta name="theme-color" content="#ffffff">
    <meta name="naver-site-verification" content="936882c1853b701b3cef3721758d80535413dbfd" />
    <meta name="yandex-verification" content="d8a47e95d0972434" />
    <meta name="localized" content="true" />
    <meta name="st:robots" content="follow,index" />
    <meta property="og:image" content="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt280217a63b82a734/6202d3378b1f312528798412/elastic-logo.svg" />
    <meta property="og:image:width" content="500" />
    <meta property="og:image:height" content="172" />
    <link rel="shortcut icon" href="/https/raw.githubusercontent.com/favicon.ico" type="image/x-icon">
    <link rel="icon" href="/https/raw.githubusercontent.com/favicon.ico" type="image/x-icon">
    <link rel="apple-touch-icon-precomposed" sizes="64x64" href="/https/raw.githubusercontent.com/favicon_64x64_16bit.png">
    <link rel="apple-touch-icon-precomposed" sizes="32x32" href="/https/raw.githubusercontent.com/favicon_32x32.png">
    <link rel="apple-touch-icon-precomposed" sizes="16x16" href="/https/raw.githubusercontent.com/favicon_16x16.png">
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/https/raw.githubusercontent.com/guide/static/styles.css" />
  </head>

  <!--© 2015-2022 Elasticsearch B.V. -->
  <!-- All Elastic documentation is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. -->
  <!-- http://creativecommons.org/licenses/by-nc-nd/4.0/ -->

  <body>
    <!-- Google Tag Manager -->
    <script>dataLayer = [];</script><noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-58RLH5" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-58RLH5');</script>
    <!-- End Google Tag Manager -->

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-12395217-16"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'UA-12395217-16');
    </script>

    <!-- Google Tag Manager for GA4 -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-KNJMG2M');</script>
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KNJMG2M" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager for GA4-->

    <div id='elastic-nav' style="display:none;"></div>
    <script src='https://www.elastic.co/elastic-nav.js'></script>

    <div class="main-container">
      <section id="content" >
        <div class="content-wrapper">

          <section id="guide" lang="en">
            <div class="container-fluid">
              <div class="row pb-3">
                <div class="col-12 order-2 col-md-4 order-md-1 col-lg-3 h-almost-full-md sticky-top-md" id="left_col">
                  <!-- The TOC is appended here -->
                </div>

                <div class="col-12 order-1 col-md-8 order-md-2 col-lg-7 order-lg-2 guide-section" id="middle_col">
                  <!-- start body -->
                  <div class="page_header">
<strong>IMPORTANT</strong>: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
<a href="../current/index.html">current release documentation</a>.
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="/https/raw.githubusercontent.com/guide/">Elastic Docs</a></span>
<span class="chevron-right">›</span><span class="breadcrumb-link"><a href="index.html">Logstash Reference [8.6]</a></span>
<span class="chevron-right">›</span><span class="breadcrumb-link"><a href="contributing-java-plugin.html">Contributing a Java Plugin</a></span>
</div>
<div class="navheader">
<span class="prev">
<a href="java-filter-plugin.html">« How to write a Java filter plugin</a>
</span>
<span class="next">
<a href="glossary.html">Glossary of Terms »</a>
</span>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h2 class="title"><a id="java-output-plugin"></a>How to write a Java output plugin</h2>
</div></div></div>
<p>To develop a new Java output for Logstash, you write a new Java class that
conforms to the Logstash Java Outputs API, package it, and install it with the
logstash-plugin utility. We&#8217;ll go through each of those steps.</p>
<h3><a id="_set_up_your_environment_4"></a>Set up your environment</h3>
<h4><a id="_copy_the_example_repo_4"></a>Copy the example repo</h4>
<p>Start by copying the <a href="https://github.com/logstash-plugins/logstash-output-java_output_example" class="ulink" target="_top">example output plugin</a>. The plugin API is currently part of the
Logstash codebase so you must have a local copy of that available. You can
obtain a copy of the Logstash codebase with the following <code class="literal">git</code> command:</p>
<div class="pre_wrapper lang-shell">
<pre class="programlisting prettyprint lang-shell">git clone --branch &lt;branch_name&gt; --single-branch https://github.com/elastic/logstash.git &lt;target_folder&gt;</pre>
</div>
<p>The <code class="literal">branch_name</code> should correspond to the version of Logstash containing the
preferred revision of the Java plugin API.</p>
<div class="note admon">
<div class="icon"></div>
<div class="admon_content">
<p>The GA version of the Java plugin API is available in the <code class="literal">7.2</code>
and later branches of the Logstash codebase.</p>
</div>
</div>
<p>Specify the <code class="literal">target_folder</code> for your local copy of the Logstash codebase. If you
do not specify <code class="literal">target_folder</code>, it defaults to a new folder called <code class="literal">logstash</code>
under your current folder.</p>
<h4><a id="_generate_the_jar_file_4"></a>Generate the .jar file</h4>
<p>After you have obtained a copy of the appropriate revision of the Logstash
codebase, you need to compile it to generate the .jar file containing the Java
plugin API. From the root directory of your Logstash codebase ($LS_HOME), you
can compile it with <code class="literal">./gradlew assemble</code> (or <code class="literal">gradlew.bat assemble</code> if you&#8217;re
running on Windows). This should produce the
<code class="literal">$LS_HOME/logstash-core/build/libs/logstash-core-x.y.z.jar</code> where <code class="literal">x</code>, <code class="literal">y</code>, and
<code class="literal">z</code> refer to the version of Logstash.</p>
<p>After you have successfully compiled Logstash, you need to tell your Java plugin
where to find the <code class="literal">logstash-core-x.y.z.jar</code> file. Create a new file named
<code class="literal">gradle.properties</code> in the root folder of your plugin project. That file should
have a single line:</p>
<div class="pre_wrapper lang-txt">
<pre class="programlisting prettyprint lang-txt">LOGSTASH_CORE_PATH=&lt;target_folder&gt;/logstash-core</pre>
</div>
<p>where <code class="literal">target_folder</code> is the root folder of your local copy of the Logstash codebase.</p>
<h3><a id="_code_the_plugin_4"></a>Code the plugin</h3>
<p>The example output plugin prints events to the console using the event&#8217;s
<code class="literal">toString</code> method. Let&#8217;s look at the main class in the example output:</p>
<div class="pre_wrapper lang-java">
<pre class="programlisting prettyprint lang-java">@LogstashPlugin(name = "java_output_example")
public class JavaOutputExample implements Output {

    public static final PluginConfigSpec&lt;String&gt; PREFIX_CONFIG =
            PluginConfigSpec.stringSetting("prefix", "");

    private final String id;
    private String prefix;
    private PrintStream printer;
    private final CountDownLatch done = new CountDownLatch(1);
    private volatile boolean stopped = false;

    public JavaOutputExample(final String id, final Configuration configuration, final Context context) {
        this(id, configuration, context, System.out);
    }

    JavaOutputExample(final String id, final Configuration config, final Context context, OutputStream targetStream) {
        this.id = id;
        prefix = config.get(PREFIX_CONFIG);
        printer = new PrintStream(targetStream);
    }

    @Override
    public void output(final Collection&lt;Event&gt; events) {
      Iterator&lt;Event&gt; z = events.iterator();
      while (z.hasNext() &amp;&amp; !stopped) {
          String s = prefix + z.next();
          printer.println(s);
        }
    }

    @Override
    public void stop() {
        stopped = true;
        done.countDown();
    }

    @Override
    public void awaitStop() throws InterruptedException {
        done.await();
    }

    @Override
    public Collection&lt;PluginConfigSpec&lt;?&gt;&gt; configSchema() {
        return Collections.singletonList(PREFIX_CONFIG);
    }

    @Override
    public String getId() {
        return id;
    }
}</pre>
</div>
<p>Let&#8217;s step through and examine each part of that class.</p>
<h4><a id="_class_declaration_8"></a>Class declaration</h4>
<div class="pre_wrapper lang-java">
<pre class="programlisting prettyprint lang-java">@LogstashPlugin(name="java_output_example")
public class JavaOutputExample implements Output {</pre>
</div>
<p>Notes about the class declaration:</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
<p>All Java plugins must be annotated with the <code class="literal">@LogstashPlugin</code> annotation. Additionally:</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
The <code class="literal">name</code> property of the annotation must be supplied and defines the name of the plugin as it will be used
in the Logstash pipeline definition. For example, this output would be referenced in the output section of the
Logstash pipeline definition as <code class="literal">output { java_output_example =&gt; { .... } }</code>
</li>
<li class="listitem">
The value of the <code class="literal">name</code> property must match the name of the class excluding casing and underscores.
</li>
</ul>
</div>
</li>
<li class="listitem">
The class must implement the <code class="literal">co.elastic.logstash.api.Output</code> interface.
</li>
<li class="listitem">
Java plugins may not be created in the <code class="literal">org.logstash</code> or <code class="literal">co.elastic.logstash</code> packages to prevent potential
clashes with classes in Logstash itself.
</li>
</ul>
</div>
<h4><a id="_plugin_settings_4"></a>Plugin settings</h4>
<p>The snippet below contains both the setting definition and the method referencing it:</p>
<div class="pre_wrapper lang-java">
<pre class="programlisting prettyprint lang-java">public static final PluginConfigSpec&lt;String&gt; PREFIX_CONFIG =
        PluginConfigSpec.stringSetting("prefix", "");

@Override
public Collection&lt;PluginConfigSpec&lt;?&gt;&gt; configSchema() {
    return Collections.singletonList(PREFIX_CONFIG);
}</pre>
</div>
<p>The <code class="literal">PluginConfigSpec</code> class allows developers to specify the settings that a
plugin supports complete with setting  name, data type, deprecation status,
required status, and default value. In this example, the <code class="literal">prefix</code> setting
defines an optional prefix to include in the output of the event. The setting is
not required and if it is not explicitly set, it defaults to the empty string.</p>
<p>The <code class="literal">configSchema</code> method must return a list of all settings that the plugin
supports. In a future phase of the Java plugin project, the Logstash execution
engine will validate that all required settings are present and that no
unsupported settings are present.</p>
<h4><a id="_constructor_and_initialization_4"></a>Constructor and initialization</h4>
<div class="pre_wrapper lang-java">
<pre class="programlisting prettyprint lang-java">private final String id;
private String prefix;
private PrintStream printer;

public JavaOutputExample(final String id, final Configuration configuration, final Context context) {
    this(configuration, context, System.out);
}

JavaOutputExample(final String id, final Configuration config, final Context context, OutputStream targetStream) {
    this.id = id;
    prefix = config.get(PREFIX_CONFIG);
    printer = new PrintStream(targetStream);
}</pre>
</div>
<p>All Java output plugins must have a constructor taking a <code class="literal">String</code> id and a
<code class="literal">Configuration</code> and <code class="literal">Context</code> argument. This is the constructor that will be
used to instantiate them at runtime. The retrieval and validation of all plugin
settings should occur in this constructor. In this example, the values of the
<code class="literal">prefix</code> setting is retrieved and stored in a local variable for later use in
the <code class="literal">output</code> method. In this example, a second, pacakge private constructor is
defined that is useful for unit testing with a <code class="literal">Stream</code> other than <code class="literal">System.out</code>.</p>
<p>Any additional initialization may occur in the constructor as well. If there are
any unrecoverable errors encountered in the configuration or initialization of
the output plugin, a descriptive exception should be thrown. The exception will
be logged and will prevent Logstash from starting.</p>
<h4><a id="_output_method"></a>Output method</h4>
<div class="pre_wrapper lang-java">
<pre class="programlisting prettyprint lang-java">@Override
public void output(final Collection&lt;Event&gt; events) {
    Iterator&lt;Event&gt; z = events.iterator();
    while (z.hasNext() &amp;&amp; !stopped) {
        String s = prefix + z.next();
        printer.println(s);
    }
}</pre>
</div>
<p>Outputs may send events to local sinks such as the console or a file or to remote systems such as Elasticsearch
or other external systems. In this example, the events are printed to the local console.</p>
<h4><a id="_stop_and_awaitstop_methods_2"></a>Stop and awaitStop methods</h4>
<div class="pre_wrapper lang-java">
<pre class="programlisting prettyprint lang-java">private final CountDownLatch done = new CountDownLatch(1);
private volatile boolean stopped;

@Override
public void stop() {
    stopped = true;
    done.countDown();
}

@Override
public void awaitStop() throws InterruptedException {
    done.await();
}</pre>
</div>
<p>The <code class="literal">stop</code> method notifies the output to stop sending events. The stop mechanism
may be implemented in any way that honors the API contract though a <code class="literal">volatile
boolean</code> flag works well for many use cases. Because this output example is so
simple, its <code class="literal">output</code> method does not check for the stop flag.</p>
<p>Outputs stop both asynchronously and cooperatively. Use the <code class="literal">awaitStop</code> method
to block until the output has  completed the stop process. Note that this method
should <span class="strong strong"><strong>not</strong></span> signal the output to stop as the <code class="literal">stop</code> method  does. The
awaitStop mechanism may be implemented in any way that honors the API contract
though a <code class="literal">CountDownLatch</code> works well for many use cases.</p>
<h4><a id="_getid_method_4"></a>getId method</h4>
<div class="pre_wrapper lang-java">
<pre class="programlisting prettyprint lang-java">@Override
public String getId() {
    return id;
}</pre>
</div>
<p>For output plugins, the <code class="literal">getId</code> method should always return the id that was provided to the plugin through its
constructor at instantiation time.</p>
<h4><a id="_unit_tests_4"></a>Unit tests</h4>
<p>Lastly, but certainly not least importantly, unit tests are strongly encouraged.
The example output plugin includes an
<a href="https://github.com/logstash-plugins/logstash-output-java_output_example/blob/main/src/test/java/org/logstashplugins/JavaOutputExampleTest.java" class="ulink" target="_top">example unit
test</a> that you can use as a template for your own.</p>
<h3><a id="_package_and_deploy_4"></a>Package and deploy</h3>
<p>Java plugins are packaged as Ruby gems for dependency management and
interoperability with Ruby plugins. Once they are packaged as gems, they may
be installed with the <code class="literal">logstash-plugin</code> utility just as Ruby plugins are.
Because no knowledge of Ruby or its toolchain should be required for Java
plugin development, the procedure for packaging Java plugins as Ruby gems
has been automated through a custom task in the Gradle build file provided
with the example Java plugins. The following sections describe how to
configure and execute that packaging task as well as how to install the
packaged Java plugin in Logstash.</p>
<h4><a id="_configuring_the_gradle_packaging_task_4"></a>Configuring the Gradle packaging task</h4>
<p>The following section appears near the top of the <code class="literal">build.gradle</code> file supplied
with the example Java plugins:</p>
<div class="pre_wrapper lang-java">
<pre class="programlisting prettyprint lang-java">// ===========================================================================
// plugin info
// ===========================================================================
group                      'org.logstashplugins' // must match the package of the main plugin class
version                    "${file("VERSION").text.trim()}" // read from required VERSION file
description                = "Example Java filter implementation"
pluginInfo.licenses        = ['Apache-2.0'] // list of SPDX license IDs
pluginInfo.longDescription = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using \$LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
pluginInfo.authors         = ['Elasticsearch']
pluginInfo.email           = ['info@elastic.co']
pluginInfo.homepage        = "http://www.elastic.co/guide/en/logstash/current/index.html"
pluginInfo.pluginType      = "filter"
pluginInfo.pluginClass     = "JavaFilterExample"
pluginInfo.pluginName      = "java_filter_example"
// ===========================================================================</pre>
</div>
<p>You should configure the values above for your plugin.</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
The <code class="literal">version</code> value will be automatically read from the <code class="literal">VERSION</code> file in the
root of your plugin&#8217;s codebase.
</li>
<li class="listitem">
<code class="literal">pluginInfo.pluginType</code> should be set to one of <code class="literal">input</code>, <code class="literal">filter</code>, <code class="literal">codec</code>,
or <code class="literal">output</code>.
</li>
<li class="listitem">
<code class="literal">pluginInfo.pluginName</code> must match the name specified on the <code class="literal">@LogstashPlugin</code>
annotation on the main plugin class. The Gradle packaging task will validate
that and return an error if they do not match.
</li>
</ul>
</div>
<h4><a id="_running_the_gradle_packaging_task_4"></a>Running the Gradle packaging task</h4>
<p>Several Ruby source files along with a <code class="literal">gemspec</code> file and a <code class="literal">Gemfile</code> are
required to package the plugin as a Ruby gem. These Ruby files are used only
for defining the Ruby gem structure or at Logstash startup time to register
the Java plugin. They are not used during runtime event processing. The
Gradle packaging task automatically generates all of these files based on
the values configured in the section above.</p>
<p>You run the Gradle packaging task with the following command:</p>
<div class="pre_wrapper lang-shell">
<pre class="programlisting prettyprint lang-shell">./gradlew gem</pre>
</div>
<p>For Windows platforms: Substitute <code class="literal">gradlew.bat</code> for <code class="literal">./gradlew</code> as appropriate in the command.</p>
<p>That task will produce a gem file in the root directory of your
plugin&#8217;s codebase with the name <code class="literal">logstash-{plugintype}-&lt;pluginName&gt;-&lt;version&gt;.gem</code></p>
<h4><a id="_installing_the_java_plugin_in_logstash_4"></a>Installing the Java plugin in Logstash</h4>
<p>After you have packaged your Java plugin as a Ruby gem, you can install it in
Logstash with this command:</p>
<div class="pre_wrapper lang-shell">
<pre class="programlisting prettyprint lang-shell">bin/logstash-plugin install --no-verify --local /path/to/javaPlugin.gem</pre>
</div>
<p>For Windows platforms: Substitute backslashes for forward slashes as appropriate in the command.</p>
<h3><a id="_running_logstash_with_the_java_output_plugin"></a>Running Logstash with the Java output plugin</h3>
<p>The following is a minimal Logstash configuration that can be used to test that
the Java output plugin is correctly installed and functioning.</p>
<div class="pre_wrapper lang-java">
<pre class="programlisting prettyprint lang-java">input {
  generator { message =&gt; "Hello world!" count =&gt; 1 }
}
output {
  java_output_example {}
}</pre>
</div>
<p>Copy the above Logstash configuration to a file such as <code class="literal">java_output.conf</code>.
Logstash should then be started with:</p>
<div class="pre_wrapper lang-txt">
<pre class="programlisting prettyprint lang-txt">bin/logstash -f /path/to/java_output.conf</pre>
</div>
<p>The expected Logstash output (excluding initialization) with the configuration
above is:</p>
<div class="pre_wrapper lang-txt">
<pre class="programlisting prettyprint lang-txt">{"@timestamp":"yyyy-MM-ddTHH:mm:ss.SSSZ","message":"Hello world!","@version":"1","host":"&lt;yourHostname&gt;","sequence":0}</pre>
</div>
<h3><a id="_feedback_4"></a>Feedback</h3>
<p>If you have any feedback on Java plugin support in Logstash, please comment on our
<a href="https://github.com/elastic/logstash/issues/9215" class="ulink" target="_top">main Github issue</a> or post in the
<a href="https://discuss.elastic.co/c/logstash" class="ulink" target="_top">Logstash forum</a>.</p>
</div>
<div class="navfooter">
<span class="prev">
<a href="java-filter-plugin.html">« How to write a Java filter plugin</a>
</span>
<span class="next">
<a href="glossary.html">Glossary of Terms »</a>
</span>
</div>
</div>

                  <!-- end body -->
                </div>

                <div class="col-12 order-3 col-lg-2 order-lg-3 h-almost-full-lg sticky-top-lg" id="right_col">
                  <div id="sticky_content">
                    <!-- The OTP is appended here -->
                    <div class="row">
                      <div class="col-0 col-md-4 col-lg-0" id="bottom_left_col"></div>
                      <div class="col-12 col-md-8 col-lg-12">
                        <div id="rtpcontainer">
                          <div class="mktg-promo" id="most-popular">
                            <p class="aside-heading">Most Popular</p>
                            <div class="pb-2">
                              <p class="media-type">Video</p>
                              <a href="https://www.elastic.co/webinars/getting-started-elasticsearch?baymax=default&elektra=docs&storm=top-video">
                                <p class="mb-0">Get Started with Elasticsearch</p>
                              </a>
                            </div>
                            <div class="pb-2">
                              <p class="media-type">Video</p>
                              <a href="https://www.elastic.co/webinars/getting-started-kibana?baymax=default&elektra=docs&storm=top-video">
                                <p class="mb-0">Intro to Kibana</p>
                              </a>
                            </div>
                            <div class="pb-2">
                              <p class="media-type">Video</p>
                              <a href="https://www.elastic.co/webinars/introduction-elk-stack?baymax=default&elektra=docs&storm=top-video">
                                <p class="mb-0">ELK for Logs & Metrics</p>
                              </a>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </section>

        </div>


<div id='elastic-footer'></div>
<script src='https://www.elastic.co/elastic-footer.js'></script>
<!-- Footer Section end-->

      </section>
    </div>

<script src="/https/raw.githubusercontent.com/guide/static/jquery.js"></script>
<script type="text/javascript" src="/https/raw.githubusercontent.com/guide/static/docs.js"></script>
<script type="text/javascript">
  window.initial_state = {}</script>
  </body>
</html>