Closed branimirackovic closed 7 years ago
Hi branimirackovic , Glad you got the plugin worked. I tried seting up the plugin and couldnt able to feed the logs from azure webapp in to on premise ELK instance. This is what we did. Appreciate if you could let me know the right procedure
Azure webapp on cloud ELK on AWS cloud Could you let me know how to install the azure logstash plugin and make it work. Thank you
Hi branimirackovic,
Can you clarify whether you are using the azureblob or azurewadtable plugins? 02sandeepreddy, I assume you are using the azureblob plugin. Have you looked at logstash log file under /var/log?
Hello Brahmes,
Thanks for your response. Correct, Im using azure blob plugin
logstash-plugin install logstash-input-azureblob
Logstash version 5.6
Inside Conf.d O created a file "azure_test.conf" with input as below
input { azureblob { storage_account_name => "XXX" storage_access_key => "XXXX" container => "containername" codec => "line" } } output { stdout {codec => rubydebug}
elasticsearch {
hosts => [ "IP1:9200", "IP2:9200", "IP3:9200" ]
index => "log-azureblob-%{+YYYY.MM.dd}"
}
}
and ran : /usr/share/logstash/bin/logstash --path.settings /etc/logstash -f azure_test.conf
Here is the log. /var/log/logstash/logstash-plain.log
[2017-10-12T18:29:04,701][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2017-10-12T18:29:07,684][WARN ][logstash.agent ] stopping pipeline {:id=>"main"}
[2017-10-12T18:29:07,686][ERROR][logstash.inputs.logstashinputazureblob] Oh My, An error occurred. undefined method type' for #<NoMethodError:0x55e71f1f>: ["/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-azureblob-0.9.12-java/lib/logstash/inputs/azureblob.rb:309:in
acquire_lease'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-azureblob-0.9.12-java/lib/logstash/inputs/azureblob.rb:417:in cleanup_registry'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-azureblob-0.9.12-java/lib/logstash/inputs/azureblob.rb:148:in
stop'", "/usr/share/logstash/logstash-core/lib/logstash/inputs/base.rb:89:in do_stop'", "org/jruby/RubyArray.java:1613:in
each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:515:in shutdown'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:426:in
stop_pipeline'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:442:in shutdown_pipelines'", "org/jruby/RubyHash.java:1342:in
each'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:442:in shutdown_pipelines'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:139:in
shutdown'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:328:in execute'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in
run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:204:in run'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in
run'", "/usr/share/logstash/lib/bootstrap/environment.rb:71:in (root)'"] {:exception=>#<NoMethodError: undefined method
type' for #
There are several interesting spots in here. Let's break them down.
The inital issue, started by @branimirackovic, is that the pipeline feels slow. This worth a trouble shooting. As a matter of fact, 10k per hour is way blow the capbility of the plugin. One possible is the data didn't reach azure blob until accumulated for a hour - WAD IIS logs uses this mechanism. @branimirackovic, could you please double check if the data is written to azure blob in real time? We can start trouble shooting from that point on.
The second issue, mentioned by @02sandeepreddy is that the configuration didn't work. An obvirous issue by callstack is that the exception is not well handled - #110, and the fix will be in #111. More interesting question here is, why is the exception. There's not enough info in the callstack to tell at this point. @02sandeepreddy, is it possible to apply the fixed in #111 in your environment and give it another shoot? Paste the logs and let's trouble shoot from there.
Thanks, Saar
@xiaomi7732 I get the error in the logs..Below is the procedure I have done Changed the code to https://github.com/Azure/azure-diagnostics-tools/pull/111 Build gem file then install logstash plugin from that gem file and started logstash.
Log output ....
tailf /var/log/logstash/logstash-plain.log
[2017-10-17T17:12:28,335][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2017-10-17T17:13:01,172][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"}
[2017-10-17T17:13:01,175][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"/usr/share/logstash/modules/netflow/configuration"}
[2017-10-17T17:13:04,168][INFO ][logstash.inputs.logstashinputazureblob] Using version 0.9.x input plugin 'azureblob'. This plugin should work but would benefit from use by folks like you. Please let us know if you find bugs or have suggestions on how to improve this plugin.
[2017-10-17T17:13:05,860][ERROR][logstash.pipeline ] Error registering plugin {:plugin=>"#<LogStash::OutputDelegator:0x7f26b5c3 @namespaced_metric=#<LogStash::Instrument::NamespacedMetric:0x2c3be7c8 @metric=#<LogStash::Instrument::Metric:0x71bf56d @collector=#<LogStash::Instrument::Collector:0x7dc30688 @agent=nil, @metric_store=#<LogStash::Instrument::MetricStore:0x37012c5e @store=#const_missing'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/client.rb:382:in
client_builder'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/client.rb:180:in initialize'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/http_client/manticore_adapter.rb:26:in
initialize'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/http_client.rb:272:in build_adapter'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/http_client.rb:276:in
build_pool'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/http_client.rb:60:in initialize'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/http_client_builder.rb:101:in
create_http_client'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/http_client_builder.rb:97:in build'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch.rb:230:in
build_client'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:24:in register'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/shared.rb:9:in
register'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator.rb:43:in register'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:290:in
register_plugin'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:301:in register_plugins'", "org/jruby/RubyArray.java:1613:in
each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:301:in register_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:310:in
start_workers'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:235:in run'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:398:in
start_pipeline'"]}
[2017-10-17T17:13:06,497][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2017-10-17T17:13:09,185][WARN ][logstash.agent ] stopping pipeline {:id=>"main"}
[2017-10-17T17:13:09,188][ERROR][logstash.inputs.logstashinputazureblob] Oh My, An error occurred. undefined method break_blob_lease' for nil:NilClass: ["/usr/share/logstash/vendor/local_gems/adb1850b/logstash-input-azureblob-0.9.12-java/lib/logstash/inputs/azureblob.rb:320:in
acquire_lease'", "/usr/share/logstash/vendor/local_gems/adb1850b/logstash-input-azureblob-0.9.12-java/lib/logstash/inputs/azureblob.rb:419:in cleanup_registry'", "/usr/share/logstash/vendor/local_gems/adb1850b/logstash-input-azureblob-0.9.12-java/lib/logstash/inputs/azureblob.rb:148:in
stop'", "/usr/share/logstash/logstash-core/lib/logstash/inputs/base.rb:89:in do_stop'", "org/jruby/RubyArray.java:1613:in
each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:515:in shutdown'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:426:in
stop_pipeline'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:442:in shutdown_pipelines'", "org/jruby/RubyHash.java:1342:in
each'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:442:in shutdown_pipelines'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:139:in
shutdown'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:328:in execute'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in
run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:204:in run'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in
run'", "/usr/share/logstash/lib/bootstrap/environment.rb:71:in (root)'"] {:exception=>#<NoMethodError: undefined method
break_blob_lease' for nil:NilClass>}
@02sandeepreddy Thanks for sending the logs. Now the problem seems in the elastic search output. To confirm, could you please comment out the elastic search output from your config file to see if the standard output works? I believe that would work. If not, please paste the new logs again.
Hello @xiaomi7732 I did as per your suggestion(Commented out ES output) and here are logs
Config file :
input { azureblob { storage_account_name => "XXX" storage_access_key => "XXXX" container => "containername" codec => "line" } } output { stdout {codec => rubydebug} }
[root@ip-10-211-43-117 bin]# tailf /var/log/logstash/logstash-plain.log
[2017-10-17T22:15:00,007][ERROR][logstash.pipeline ] Error registering plugin {:plugin=>"<LogStash::Inputs::LogstashInputAzureblob storage_account_name=>\"XXXXX\", storage_access_key=>\"XXXX\", container=>\"XX\", codec=><LogStash::Codecs::Line id=>\"line_f8a178e7-fdef-4a33-8f0c-87c8ee926c92\", enable_metric=>true, charset=>\"UTF-8\", delimiter=>\"\n\">, id=>\"afde19387b533f3560bf8e87b6c1cbcb18fd7965-1\", enable_metric=>true, endpoint=>\"core.windows.net\", registry_path=>\"data/registry\", registry_lease_duration=>15, interval=>30, registry_create_policy=>\"resume\", file_head_bytes=>0, file_tail_bytes=>0, blob_list_page_size=>100, file_chunk_size_bytes=>4194304>", :error=>"bind: name or service not known"}
[2017-10-17T22:15:00,157][ERROR][logstash.agent ] Pipeline aborted due to error {:exception=>#bind'", "/usr/share/logstash/vendor/jruby/lib/ruby/1.9/resolv.rb:638:in
bind_random_port'", "/usr/share/logstash/vendor/jruby/lib/ruby/1.9/resolv.rb:723:in initialize'", "org/jruby/RubyArray.java:1613:in
each'", "/usr/share/logstash/vendor/jruby/lib/ruby/1.9/resolv.rb:707:in initialize'", "/usr/share/logstash/vendor/jruby/lib/ruby/1.9/resolv.rb:545:in
make_udp_requester'", "/usr/share/logstash/vendor/jruby/lib/ruby/1.9/resolv.rb:500:in each_resource'", "/usr/share/logstash/vendor/jruby/lib/ruby/1.9/resolv.rb:480:in
getresource'", "/usr/share/logstash/vendor/jruby/lib/ruby/shared/rubygems/remote_fetcher.rb:92:in api_endpoint'", "/usr/share/logstash/vendor/jruby/lib/ruby/shared/rubygems/source.rb:46:in
api_uri'", "/usr/share/logstash/vendor/jruby/lib/ruby/shared/rubygems/source.rb:182:in load_specs'", "/usr/share/logstash/vendor/jruby/lib/ruby/shared/rubygems/spec_fetcher.rb:261:in
tuples_for'", "/usr/share/logstash/vendor/jruby/lib/ruby/shared/rubygems/spec_fetcher.rb:226:in available_specs'", "org/jruby/RubyArray.java:1613:in
each'", "/usr/share/logstash/vendor/jruby/lib/ruby/shared/rubygems/source_list.rb:97:in each_source'", "/usr/share/logstash/vendor/jruby/lib/ruby/shared/rubygems/spec_fetcher.rb:222:in
available_specs'", "/usr/share/logstash/vendor/jruby/lib/ruby/shared/rubygems/spec_fetcher.rb:102:in search_for_dependency'", "/usr/share/logstash/vendor/jruby/lib/ruby/shared/rubygems/spec_fetcher.rb:166:in
spec_for_dependency'", "/usr/share/logstash/vendor/jruby/lib/ruby/shared/rubygems.rb:809:in latest_spec_for'", "/usr/share/logstash/vendor/local_gems/adb1850b/logstash-input-azureblob-0.9.12-java/lib/logstash/inputs/azureblob.rb:124:in
register'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:290:in register_plugin'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:301:in
register_plugins'", "org/jruby/RubyArray.java:1613:in each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:301:in
register_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:458:in start_inputs'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:348:in
start_workers'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:235:in run'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:398:in
start_pipeline'"]}
[2017-10-17T22:15:00,288][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2017-10-17T22:15:03,196][WARN ][logstash.agent ] stopping pipeline {:id=>"main"}
[2017-10-17T22:15:03,218][ERROR][logstash.inputs.logstashinputazureblob] Oh My, An error occurred. undefined method break_blob_lease' for nil:NilClass: ["/usr/share/logstash/vendor/local_gems/adb1850b/logstash-input-azureblob-0.9.12-java/lib/logstash/inputs/azureblob.rb:320:in
acquire_lease'", "/usr/share/logstash/vendor/local_gems/adb1850b/logstash-input-azureblob-0.9.12-java/lib/logstash/inputs/azureblob.rb:419:in cleanup_registry'", "/usr/share/logstash/vendor/local_gems/adb1850b/logstash-input-azureblob-0.9.12-java/lib/logstash/inputs/azureblob.rb:148:in
stop'", "/usr/share/logstash/logstash-core/lib/logstash/inputs/base.rb:89:in do_stop'", "org/jruby/RubyArray.java:1613:in
each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:515:in shutdown'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:426:in
stop_pipeline'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:442:in shutdown_pipelines'", "org/jruby/RubyHash.java:1342:in
each'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:442:in shutdown_pipelines'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:139:in
shutdown'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:328:in execute'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in
run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:204:in run'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in
run'", "/usr/share/logstash/lib/bootstrap/environment.rb:71:in (root)'"] {:exception=>#<NoMethodError: undefined method
break_blob_lease' for nil:NilClass>}
[2017-10-17T22:15:11,168][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"}
[2017-10-17T22:15:11,171][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"/usr/share/logstash/modules/netflow/configuration"}
[2017-10-17T22:15:11,660][ERROR][logstash.plugins.registry] Problems loading a plugin with {:type=>"input", :name=>"azureblob", :path=>"logstash/inputs/azureblob", :error_message=>"uninitialized constant JSON::Ext::Parser", :error_class=>NameError, :error_backtrace=>["org/jruby/RubyModule.java:2746:in const_missing'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/json-1.8.6-java/lib/json/ext.rb:16:in
Ext'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/json-1.8.6-java/lib/json/ext.rb:12:in JSON'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/json-1.8.6-java/lib/json/ext.rb:9:in
(root)'", "org/jruby/RubyKernel.java:1040:in require'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/polyglot-0.3.5/lib/polyglot.rb:65:in
require'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/json-1.8.6-java/lib/json.rb:1:in (root)'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/json-1.8.6-java/lib/json.rb:58:in
JSON'", "org/jruby/RubyKernel.java:1040:in require'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/polyglot-0.3.5/lib/polyglot.rb:65:in
require'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/json-1.8.6-java/lib/json.rb:54:in (root)'", "org/jruby/RubyKernel.java:1040:in
require'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/polyglot-0.3.5/lib/polyglot.rb:65:in require'", "/usr/share/logstash/vendor/local_gems/adb1850b/logstash-input-azureblob-0.9.12-java/lib/logstash/inputs/azureblob.rb:1:in
(root)'", "/usr/share/logstash/vendor/local_gems/adb1850b/logstash-input-azureblob-0.9.12-java/lib/logstash/inputs/azureblob.rb:7:in (root)'", "/usr/share/logstash/logstash-core/lib/logstash/plugins/registry.rb:1:in
(root)'", "/usr/share/logstash/logstash-core/lib/logstash/plugins/registry.rb:156:in legacy_lookup'", "/usr/share/logstash/logstash-core/lib/logstash/plugins/registry.rb:138:in
lookup'", "/usr/share/logstash/logstash-core/lib/logstash/plugins/registry.rb:180:in lookup_pipeline_plugin'", "org/jruby/RubyKernel.java:1079:in
eval'", "/usr/share/logstash/logstash-core/lib/logstash/plugin.rb:140:in lookup'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:103:in
plugin'", "(eval):8:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:75:in
initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:165:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:286:in
create_pipeline'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:95:in register_pipeline'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:313:in
execute'", "/usr/share/logstash/lib/bootstrap/environment.rb:71:in (root)'"]} [2017-10-17T22:15:11,682][ERROR][logstash.agent ] Cannot create pipeline {:reason=>"Couldn't find any input plugin named 'azureblob'. Are you sure this is correct? Trying to load the azureblob input plugin resulted in this error: Problems loading the requested plugin named azureblob of type input. Error: NameError uninitialized constant JSON::Ext::Parser"} [2017-10-17T22:15:19,698][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"} [2017-10-17T22:15:19,700][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"/usr/share/logstash/modules/netflow/configuration"} [2017-10-17T22:15:20,226][ERROR][logstash.plugins.registry] Problems loading a plugin with {:type=>"input", :name=>"azureblob", :path=>"logstash/inputs/azureblob", :error_message=>"uninitialized constant JSON::Ext::Generator", :error_class=>NameError, :error_backtrace=>["org/jruby/RubyModule.java:2746:in
const_missing'",
@02sandeepreddy , Thanks for the logs. By reading the logs, it seems that the udp port is taken and logstash / jruby is not handling the case correctly by choosing another random port. This is beyond the control of the azureblob input plugin.
It seems like this issue: https://github.com/elastic/logstash/issues/1587, however, it should have been fixed.
At this point, I would suggest you open a ticket here: https://discuss.elastic.co/c/logstash, to get some help from elastic.
@xiaomi7732
Thanks for your time . Im going to do that now
Close this one since there's no action item from plug-in end. Feel free to re-open it if there's follow up on this issue.
Hi,
Thank you for this plugin and effort, I am using system with three storage accounts and one ELK. I have a problem with slow reading of data from storage depending of traffic I have. Data needs from several minutes to several hours to arrive to Logstash.
Does anyone else experience the same issue? These are systems with about 10k records per hour. Thanks Acko