Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noob configuration guidance please #1

Open
DazWilkin opened this issue Jun 16, 2016 · 3 comments
Open

Noob configuration guidance please #1

DazWilkin opened this issue Jun 16, 2016 · 3 comments

Comments

@DazWilkin
Copy link

I found your plugin but am struggling (I think) to configure it correctly.

Installed (successfully?)

fluent-gem install fluentd-plugin-rss
Fetching: fluent-plugin-rss-0.0.1.gem (100%)
Successfully installed fluent-plugin-rss-0.0.1
Parsing documentation for fluent-plugin-rss-0.0.1
Installing ri documentation for fluent-plugin-rss-0.0.1
Done installing documentation for fluent-plugin-rss after 0 seconds
1 gem installed
fluent-gem list
*** LOCAL GEMS ***
...
fluent-plugin-rss (0.0.1)
...

Configured (unclear)

Currently have both rss.conf and fluent-plugin-rss.conf

The 'type' property was not referenced but I think it should be 'rss'? Looking at your source (not a Ruby developer), it appears the 'tag' is to identify the emitted data so could be anything. I've tried various permutations of this:

<source>
  type rss
  tag cnn
  url http://rss.cnn.com/rss/cnn_latest.rss
  attrs date, title
</source>

Reviewing your code, it appears the RSS feed must contain a 'date' element. And I suspected this was the problem with the 1st feed that I tried which contained no 'date'. I extracted the RSS parsing and enumeration from your plugin (below). I've tried 2 other feeds that both use 'pubDate' (http://lorem-rss.herokuapp.com/feed; http://rss.cnn.com/rss/cnn_latest.rss) and these both work; they're 'put' and I assume would be emitted too.

#!/usr/bin/env ruby
require 'rss'

@tag = 'test'
@current_time = Time.new(2016,6,15,0,0,0, "+09:00").utc
@url = 'http://rss.cnn.com/rss/cnn_latest.rss'

next_current_time = @current_time

rss = RSS::Parser.parse(@url)

rss.items.each do |item|
    time = Time.parse item.date.to_s
    if time > @current_time
        puts "#{@tag} --- #{Time.parse(item.date.to_s)} --- #{item.title}"
        next_current_time = time if time > next_current_time
    end
end

I see no evident output :-(

So I'm doing something wrong. Any help would be appreciated.

@harukasan
Copy link
Owner

harukasan commented Jun 17, 2016

Thank you for your reporting!

When the date attribute does not exist, this plugins seems to fail to set the time attribute of the record.
I have plan to fix it and some known problems in this month.

@DazWilkin
Copy link
Author

Thank you for your reply!

Does my config file look accurate?

<source>
  type rss
  tag cnn
  url http://rss.cnn.com/rss/cnn_latest.rss
  attrs date, title
</source>

Should it be named "rss.conf" or "fluent-plugin-rss.conf" or does it not matter?

@azimut
Copy link

azimut commented Jul 1, 2017

@harukasan any chance to get a beta release of the changes? I am trying to fix a couple of issues but want to know if there is anything else there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants