# Azure Event Hubs plugin problem

**URL:** <https://discuss.elastic.co/t/azure-event-hubs-plugin-problem/275463>\
**Category:** Logstash\
**Created:** [June 9, 2021, 3:26pm UTC](https://discuss.elastic.co/t/azure-event-hubs-plugin-problem/275463 "2021-06-09T15:26:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cRaZyT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/crazyt/32/90071_2.png) [@cRaZyT](https://discuss.elastic.co/u/cRaZyT)\
**Post date:** [June 9, 2021, 3:26pm UTC](https://discuss.elastic.co/t/azure-event-hubs-plugin-problem/275463/1 "2021-06-09T15:26:03Z")

</div>

Hi there,

I've installed logstash 7.13.1 and the logstash-input-azure\_event\_hubs 1.3.0 plugin.

I got the following error during the initialization:

> [ERROR][logstash.inputs.azureeventhubs][main][07395995e41d84f42b907d44ee2f6bbd6eedfb89f0d117d0a2f18870b0b1b694] Event Hub failed during initialization. {:event\_hub\_name=\>"insights-operational-logs", :exception=\>#\<NoMethodError: undefined method `value' for #<String:0x7f715d23>>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-azure_event_hubs-1.3.0/lib/logstash/inputs/azure_event_hubs.rb:390:in `block in run'"]}
> 
> [ERROR][logstash.inputs.azureeventhubs][main][07395995e41d84f42b907d44ee2f6bbd6eedfb89f0d117d0a2f18870b0b1b694] Event Hub failed during initialization. {:event\_hub\_name=\>"event\_hub2", :exception=\>#\<NoMethodError: undefined method `value' for #<String:0x32a4ddfb>>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-azure_event_hubs-1.3.0/lib/logstash/inputs/azure_event_hubs.rb:390:in `block in run'"]}

The input looks like this:

```auto
input {
   azure_event_hubs {
      config_mode => "advanced"
      threads => 8
      decorate_events => true
      checkpoint_interval => 5
      storage_connection => "DefaultEndpointsProtocol=https;AccountName=aqsdevsa;AccountKey=XXXXX==;EndpointSuffix=core.windows.net"
      event_hubs => [
        { "insights-operational-logs" => {
          event_hub_connections => ["Endpoint=sb://XXXXX.servicebus.windows.net/;SharedAccessKeyName=XXXXX;SharedAccessKey=XXXXX=;EntityPath=insights-operational-logs"]
          consumer_group => "$Default"
        }},
        { "event_hub2" => {
          event_hub_connections => ["Endpoint=sb://XXXXX.servicebus.windows.net/;SharedAccessKeyName=PreviewDataPolicy;SharedAccessKey=XXXXX=;EntityPath=event_hub2"]
          consumer_group => "$Default"
        }}
      ]
   }
}

filter {
   split {
     field => ["records"]
   }
}

output {
  elasticsearch {
    hosts => ["https://XXXXX.azure.elastic-cloud.com:9200"]
    data_stream => false
    index => "eventhub-%{+YYYY.MM.dd}"
    user => "XXXXX"
    password => "XXXXX"
  }
}

```

I also have tried this filter without success:

```auto
filter {
   json {
      source => "message"
   }
   split {
     field => ["records"]
   }
}

```

The same error message appears even without a filter.

Has some an idea what I made wrong in the pipeline.yml?

Thanky in adavand

Regards  
Thorsten

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 9, 2021, 4:02pm UTC](https://discuss.elastic.co/t/azure-event-hubs-plugin-problem/275463/2 "2021-06-09T16:02:03Z")

</div>

Your configuration is wrong.

Since you are using the `config_mode` as `advanced` you should use `event_hub_connection` not `event_hub_connections`.

This settings is also a string, not an array.

It should be:

```auto
      event_hubs => [
        { "insights-operational-logs" => {
          event_hub_connection => "Endpoint=sb://XXXXX.servicebus.windows.net/;SharedAccessKeyName=XXXXX;SharedAccessKey=XXXXX=;EntityPath=insights-operational-logs"
          consumer_group => "$Default"
        }},
        { "event_hub2" => {
          event_hub_connection => "Endpoint=sb://XXXXX.servicebus.windows.net/;SharedAccessKeyName=PreviewDataPolicy;SharedAccessKey=XXXXX=;EntityPath=event_hub2"
          consumer_group => "$Default"
        }}
      ]

```

You can check this in the [documentation](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-azure_event_hubs.html#plugins-inputs-azure_event_hubs-eh_advanced_config).

---

<div class="post-metadata">

**Author:** ![cRaZyT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/crazyt/32/90071_2.png) [@cRaZyT](https://discuss.elastic.co/u/cRaZyT)\
**Post date:** [June 10, 2021, 10:57am UTC](https://discuss.elastic.co/t/azure-event-hubs-plugin-problem/275463/3 "2021-06-10T10:57:36Z")

</div>

Thank you [leandrojmp](https://discuss.elastic.co/u/leandrojmp), I was probably blind because I totally overlooked that! You really saved my day.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 8, 2021, 10:57am UTC](https://discuss.elastic.co/t/azure-event-hubs-plugin-problem/275463/4 "2021-07-08T10:57:42Z")

</div>

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