Get a DemoStart Free TrialSign In

ActiveMQ Logs

Ship logs from a ActiveMQ message queue to logstash

Filebeat is a lightweight shipper that enables you to send your ActiveMQ message queue logs to Logstash and Elasticsearch. Configure Filebeat using the pre-defined examples below to start sending and analysing your ActiveMQ message queue logs.

Follow this step by step guide to get 'logs' from your system to Logit.io:

Step 1 - Configure the input.conf

Create the 00_input.conf file

  input {
    jms {
      broker_url => 'failover:(tcp://{yourhost}:61616)?initialReconnectDelay=100'
      destination => 'yourdestination'
      factory => 'org.apache.activemq.ActiveMQConnectionFactory'
      username => 'your-username'
      password => 'your-password'
      require_jars => ['/usr/share/jms/activemq-all-{version}.jar']
    }
  } 

Step 2 - Configure the output

Create the 95_output.conf file to use tcp

  output {
    tcp {
        codec => json_lines
        host => "your-logstash-host"
        port => your-ssl-port
        ssl_enable => true
      }
    }

Step 3 - Configure the log4j2.properties

Create the log4j2.properties file

status = error

appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n

rootLogger.level = info
rootLogger.appenderRef.console.ref = console

Step 4 - Install Logstash

Docker (/Ubuntu/Mac)

Create the Dockerfile

FROM docker.elastic.co/logstash-oss:$version

Run  logstash-plugin install logstash-input-jms

Build the docker image

docker build -t $Image_name:version .

Run the image

  docker run -d --name ls \
    -v $(pwd)/config/log4j2.properties:/etc/logstash/log4j2.properties:ro \
    -v path_to_configuration_files:/cusdata:rw \
    -p 9600:9600 \
    -p 5044:5044 \
    -p 3389:3389 \
    logit/logstash:6.8.4 \
    /usr/share/logstash/bin/logstash -f '/cusdata/*.conf' \
    --config.reload.automatic \
    --http.host=0.0.0.0 

Step 5 - how to diagnose no data in Stack

If you don't see data appearing in your Stack after following the steps, visit the Help Centre guide for steps to diagnose no data appearing in your Stack or Chat to support now.

Return to Search
Sign Up

© 2024 Logit.io Ltd, All rights reserved.