Filebeat is not running after ELK setup in ubuntu machine

Hi Team,
Recently I started setting up ELK in one of the ubuntu machines and Filebeat in someother machine using the https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-ubuntu-14-04

But after making changes in the filebeat.yml file when i run a command to check if filebeat is running I get a message filebeat is not running.
Can someone please help me?

Please find my filebeat.yml configuration as below: -

            ###################### Filebeat Configuration Example #########################

            # This file is an example configuration file highlighting only the most common
            # options. The filebeat.full.yml file from the same directory contains all the
            # supported options with more comments. You can use it as a reference.
            #
            # You can find the full configuration reference here:
            # https://www.elastic.co/guide/en/beats/filebeat/index.html

            #=========================== Filebeat prospectors =============================

            filebeat.prospectors:

            # Each - is a prospector. Most options can be set at the prospector level, so
            # you can use different prospectors for various configurations.
            # Below are the prospector specific configurations.

            - input_type: log
            3
              # Paths that should be crawled and fetched. Glob based paths.
              paths:
            #     - /var/log/auth.log
            #     - /x/ebay/cronus/software/service_nodes/.ENVdmi8mz9xt7.ppplusbrcpmnodeweb-app__ENVdmi8mz9xt7.ppplusbrcpmnodeweb-app__ENVdmi8mz9xt7-GCE01-CLj4h3zol5-CPTdminappsfm/manifests/active/lcmppplusbrcpmnodeweb/cronus/scripts/log/applogs/nodeapp.log
            #    - /var/log/*.log
                 - /var/log/filebeat/*.log
            document_type: log
                #- c:\programdata\elasticsearch\logs\*

              # Exclude lines. A list of regular expressions to match. It drops the lines that are
              # matching any regular expression from the list.
              #exclude_lines: ["^DBG"]

              # Include lines. A list of regular expressions to match. It exports the lines that are
              # matching any regular expression from the list.
              #include_lines: ["^ERR", "^WARN"]

              # Exclude files. A list of regular expressions to match. Filebeat drops the files that
              # are matching any regular expression from the list. By default, no files are dropped.
              #exclude_files: [".gz$"]

              # Optional additional fields. These field can be freely picked
              # to add additional information to the crawled log files for filtering
             #fields:
              #  level: debug
              #  review: 1

              ### Multiline options

              # Mutiline can be used for log messages spanning multiple lines. This is common
              # for Java Stack Traces or C-Line Continuation

              # The regexp Pattern that has to be matched. The example pattern matches all lines starting with [
              #multiline.pattern: ^\[

              # Defines if the pattern set under pattern should be negated or not. Default is false.
              #multiline.negate: false

              # Match can be set to "after" or "before". It is used to define if lines should be append to a pattern
              # that was (not) matched before or after or as long as a pattern is not matched based on negate.
              # Note: After is the equivalent to previous and before is the equivalent to to next in Logstash
              #multiline.match: after


            #================================ General =====================================

            # The name of the shipper that publishes the network data. It can be used to group
            # all the transactions sent by a single shipper in the web interface.
            #name:

            # The tags of the shipper are included in their own field with each
            # transaction published.
            #tags: ["service-X", "web-tier"]

            # Optional fields that you can specify to add additional information to the
            # output.
            #fields:
            #  env: staging

            #================================ Outputs =====================================

            # Configure what outputs to use when sending the data collected by the beat.
            # Multiple outputs may be used.

            #-------------------------- Elasticsearch output ------------------------------
            #output.elasticsearch:
              # Array of hosts to connect to.
             # hosts: ["localhost:9200"]

              # Optional protocol and basic auth credentials.
              #protocol: "https"
              #username: "elastic"
              #password: "changeme"

            #----------------------------- Logstash output --------------------------------
            output.logstash:
              # The Logstash hosts
              hosts: ["My Private IP address:5044"]
              bulk_max_size: 1024
              # Optional SSL. By default is off.
              # List of root certificates for HTTPS server verifications
              tls:
               certificate_authorities: ["/etc/pki/tls/certs/logstash-forwarder.crt"]

              # Certificate for SSL client authentication
              #ssl.certificate: "/etc/pki/client/cert.pem"

              # Client Certificate Key
              #ssl.key: "/etc/pki/client/cert.key"

              #================================ Logging =====================================

              # Sets log level. The default log level is inf />o.
              # Avilable log levels are: critical, error, warning, info, debug
              #logging.level: info

              # At debug level, you can selectively enable logging only for some components.
              # To enable all selectors use ["*"]. Examples of other selectors are "beat",
              # "publish", "service".
              #logging.selectors: ["*"]

Please format your code using the </> button, or markdown style back ticks. It helps to make things easy to read which helps us help you :slight_smile:

Hi Warkolm,
I have formatted the file as suggested by you. Can you please help me what I am missing that I am not able to see filebeat running

Please provide the logs you are seeing :slight_smile:

Also, what version of filebeat are you using?

Hi Mark,
I am not sure which location the logs are logged. When I try to get the version it says command not found.

Can you please tell me the location where the logs will be I will search and the contents here?

Please find the version as below: -
5.6.4

Thanks and Regards,
Anuj Jain

Hi Team,
Filebeat is running now. But I was getting connection reset by peer in logstash. So I upgraded the versions of Elastic and logstash to 5.6.4 and 5.6.4 . But now when i try to execute the sudo service logstash configtest to test my logstash configuration I am getting below error :-1:

/etc/init.d/logstash: 148: /etc/init.d/logstash: /opt/logstash/bin/logstash: not found

Getting below errors in logstash

[2017-11-22T05:43:39,604][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://127.0.0.1:9200/, :path=>"/"}
[2017-11-22T05:43:39,618][WARN ][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>"http://127.0.0.1:9200/"}
[2017-11-22T05:43:41,943][ERROR][logstash.pipeline        ] A plugin had an unrecoverable error. Will restart this plugin.
  Plugin: <LogStash::Inputs::Beats port=>5044, ssl=>true, ssl_certificate=>"/etc/pki/tls/certs/logstash-forwarder.crt", ssl_key=>"/etc/pki/tls/private/logstash-forwarder.key", client_inactivity_timeout=>6000, id=>"06e3f4078aaeba48ad1561aac31351a5890ff061-1", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_b94ec064-115b-4a51-80bf-39cde25faecb", enable_metric=>true, charset=>"UTF-8">, host=>"0.0.0.0", ssl_verify_mode=>"none", include_codec_tag=>true, ssl_handshake_timeout=>10000, congestion_threshold=>5, target_field_for_codec=>"message", tls_min_version=>1, tls_max_version=>1.2, cipher_suites=>["TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"]>
  Error: Address already in use
[2017-11-22T05:43:42,944][INFO ][org.logstash.beats.Server] Starting server on port: 5044
[2017-11-22T05:43:42,947][WARN ][io.netty.channel.AbstractChannel] Force-closing a channel whose registration task was not accepted by an event loop: [id: 0x037ddf36]
java.util.concurrent.RejectedExecutionException: event executor terminated
        at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:840) ~[netty-all-4.1.3.Final.jar:4.1.3.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:342) ~[netty-all-4.1.3.Final.jar:4.1.3.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:335) ~[netty-all-4.1.3.Final.jar:4.1.3.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:765) ~[netty-all-4.1.3.Final.jar:4.1.3.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.register(AbstractChannel.java:475) [netty-all-4.1.3.Final.jar:4.1.3.Final]
        at io.netty.channel.SingleThreadEventLoop.register(SingleThreadEventLoop.java:80) [netty-all-4.1.3.Final.jar:4.1.3.Final]
        at io.netty.channel.SingleThreadEventLoop.register(SingleThreadEventLoop.java:74) [netty-all-4.1.3.Final.jar:4.1.3.Final]
        at io.netty.channel.MultithreadEventLoopGroup.register(MultithreadEventLoopGroup.java:85) [netty-all-4.1.3.Final.jar:4.1.3.Final]
        at io.netty.bootstrap.AbstractBootstrap.initAndRegister(AbstractBootstrap.java:330) [netty-all-4.1.3.Final.jar:4.1.3.Final]
        at io.netty.bootstrap.AbstractBootstrap.doBind(AbstractBootstrap.java:281) [netty-all-4.1.3.Final.jar:4.1.3.Final]
         at io.netty.bootstrap.AbstractBootstrap.bind(AbstractBootstrap.java:277) [netty-all-4.1.3.Final.jar:4.1.3.Final]
        at io.netty.bootstrap.AbstractBootstrap.bind(AbstractBootstrap.java:259) [netty-all-4.1.3.Final.jar:4.1.3.Final]
        at org.logstash.beats.Server.listen(Server.java:69) [logstash-input-beats-3.1.24.jar:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_151]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
        at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:436) [?:?]
        at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:300) [?:?]
        at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:35) [?:?]

Can you please help me understand and fix the issue?

Do you have multiple beats input defined on the same port or other input like the TCP or UDP using the same port as the beats input?

EDITED:

That error is raised when you run the config test or when you restart logstash?

We have an open issue on the beats input to help with that problem, we should so a better job to check if the port is already taken.

Hi Pier,
Sure I will try that and thank you so much for your response!!!!

Thanks and Regards,
Anuj Jain

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.