RSS NoMethodError nil:NilClass

I've just started working with Logstash 6.2.4 and want to use it with RSS feeds. I've installed the RSS plugin and I'm using this as my pipeline.conf:

input {
	rss {
	url => "http://www.nrk.no/rss"
	interval => 60
		tags => ["rss"]
	}
}
# filter {
#}
output {
    elasticsearch {
		action => "index"
        hosts => [ "localhost:9200" ]
		index => "rss"
		workers => 1
    }
	stdout {}
}

When I run this using

.\bin/logstash -f first-pipeline.conf --config.reload.automatic

in windows powershell I get the following error.

[2018-05-24T08:44:01,354][INFO ][logstash.inputs.rss ] Polling RSS {:url=>"RSS"}
[2018-05-24T08:44:01,447][ERROR][logstash.inputs.rss ] Uknown error while parsing the feed {:url=>"RSS", :exception=>#<NoMethodError: undefined method `items' for nil:NilClass>}
[2018-05-24T08:44:01,463][INFO ][logstash.inputs.rss ] Command completed {:command=>nil, :duration=>0.109}

I've tried to search for this and read on similar topics but is unable to understand what needs to be done. I can provide additional information if it'll help.

If you look at the source code, it is doing this

body = response.body
begin
  feed = RSS::Parser.parse(body)
  feed.items.each do |item|

I suspect it is trying to tell you that what it got from http://www.nrk.no/rss is not parseable.

1 Like

Yes the problem seemed to be with what it is receiving rather than my setup. When I tried it with another URL ("http://feeds.washingtonpost.com/rss/world") it worked fine.

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