title: Unable to connect to rabbit mq using logstash
body: <p>I am trying to publish message to rabbitmq using logstash 6.7 . Logstash giving me error saying refused connection to localhost where i explicitly mentioned remote host address. </p>
  
  <pre><code>input {
    kafka {
      id =&gt; "metrics.all"
      bootstrap_servers =&gt; "kafka-host:6000"
      group_id =&gt; "group_1"
      security_protocol =&gt; "SSL"
      ssl_truststore_location =&gt; "truststore.jks"
      ssl_keystore_location =&gt; "keystore.jks"
      ssl_keystore_password =&gt; "password"
      ssl_key_password =&gt; "password"
      topics =&gt; "metrics.all"
      ssl_endpoint_identification_algorithm =&gt; ""
    }
  }
  
  filter {
    json {
      source =&gt; "message"
      target =&gt; "sample"
    }
  
    split {
      field =&gt; "[sample][contents][metrics][data]"
      target =&gt; "metric"
    }
  
    if [metric][app] != "appMetrics" {
      drop {}
    }
  
    if ".d.percentile-99" not in [metric][metric] {
      drop {}
    }
  
    mutate {
      gsub =&gt; ["[metric][metric]", ".d.percentile-99", ""]
    }
  }
  
  output {
    rabbitmq {
      id =&gt; "out.metrics.all"
      host =&gt; "rmq-host-url.com"
      port =&gt; 3000
      exchange =&gt; "rmq.exchange.metrics"
      exchange_type =&gt; "direct"
      vhost =&gt; "rmq-metrics"
      user =&gt; "rmq-metrics"
      password =&gt; "rmq-metrics"
      key =&gt; "metrics"
      durable =&gt; true
      automatic_recovery =&gt; true
      heartbeat =&gt; 0
      message_properties =&gt; {
        "content_encoding" =&gt; "RAW"
      }
  
      codec =&gt; line {
        format =&gt; "&lt;?xml version='1.0' encoding='UTF-8'?&gt;
                   &lt;stats&gt;
                     &lt;as_of_ts&gt;%{[sample][output_time]}&lt;/as_of_ts&gt;
                     &lt;metric&gt;%{[metric][metric]}&lt;/metric&gt;
                     &lt;client&gt;9002&lt;/client&gt;
                     &lt;value&gt;%{[metric][value]}&lt;/value&gt;
                   &lt;/stats&gt;"
      }
    }
  }
  </code></pre>
  
  <p>But I am able to read messages from kafka and able to extract and transform them desired form. I used output file plugin to see the data. It was successful. But trying to connect to rabbitmq and publish is failing. error message doesn't make any sense. can any help me. what i did wrong? </p>
  
  <pre><code>[2019-04-08T13:46:05,564][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
  [2019-04-08T13:46:05,621][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=&gt;"6.7.0"}
  [2019-04-08T13:46:23,905][INFO ][logstash.pipeline        ] Starting pipeline {:pipeline_id=&gt;"main", "pipeline.workers"=&gt;20, "pipeline.batch.size"=&gt;125, "pipeline.batch.delay"=&gt;50}
  [2019-04-08T13:46:24,305][ERROR][logstash.outputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=&gt;"Connection to localhost:5672 refused", :exception=&gt;"MarchHare::ConnectionRefused"}
  [2019-04-08T13:46:25,353][ERROR][logstash.outputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=&gt;"Connection to localhost:5672 refused", :exception=&gt;"MarchHare::ConnectionRefused"}
  [2019-04-08T13:46:26,370][ERROR][logstash.outputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=&gt;"Connection to localhost:5672 refused", :exception=&gt;"MarchHare::ConnectionRefused"}
  [2019-04-08T13:46:27,378][ERROR][logstash.outputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=&gt;"Connection to localhost:5672 refused", :exception=&gt;"MarchHare::ConnectionRefused"}
  [2019-04-08T13:46:28,385][ERROR][logstash.outputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=&gt;"Connection to localhost:5672 refused", :exception=&gt;"MarchHare::ConnectionRefused"}
  [2019-04-08T13:46:29,393][ERROR][logstash.outputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=&gt;"Connection to localhost:5672 refused", :exception=&gt;"MarchHare::ConnectionRefused"}
  [2019-04-08T13:46:30,403][ERROR][logstash.outputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=&gt;"Connection to localhost:5672 refused", :exception=&gt;"MarchHare::ConnectionRefused"}
  [2019-04-08T13:46:31,412][ERROR][logstash.outputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=&gt;"Connection to localhost:5672 refused", :exception=&gt;"MarchHare::ConnectionRefused"}
  [2019-04-08T13:46:32,422][ERROR][logstash.outputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=&gt;"Connection to localhost:5672 refused", :exception=&gt;"MarchHare::ConnectionRefused"}
  [2019-04-08T13:46:33,430][ERROR][logstash.outputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=&gt;"Connection to localhost:5672 refused", :exception=&gt;"MarchHare::ConnectionRefused"}
  </code></pre>