Logstash plugin to pull daily reports from the Google Analytics v3 Core Reporting API.
Forked from https://github.com/russorat/logstash-input-googleanalytics.git.
Documentation can be seen in the docs folder (for now). Hopefully, this moves to logstash-plugins repo soon, so it can be rendered properly on elastic.co,
-
To get started, you'll need JRuby with the Bundler gem installed (
jruby -S gem install bundler
). -
Install dependencies
jruby -S bundle install
- Run tests
jruby -S bundle exec rspec
- Edit Logstash's
Gemfile
and add the local plugin path, for example:
gem "logstash-input-google-analytics-daily", :path => "/your/local/logstash-input-googleanalytics"
- Install the plugin
bin/plugin install --no-verify
- Run Logstash with your plugin Example logstash.conf:
input {
google_analytics_daily {
view_id => "ga:62549480"
metrics => ["ga:users","ga:sessions"]
key_file_path => "C:/logstash-7.6.1/keyfile.json"
dates => ['yesterday', '2020-04-05']
dimensions => ['ga:browser', 'ga:city']
}
}
output {
stdout {
codec => rubydebug
}
}
bin/logstash -f logstash.conf
NOTE: Any modifications to the plugin code will not show up until you restart Logstash.
Logstash by editing its Gemfile
and pointing the :path
to your local plugin development directory or you can build the gem and install it using:
- Build your plugin gem
jruby -S gem build logstash-input-google-analytics-daily.gemspec
- Install the plugin from the Logstash home
bin/plugin install install Projects/logstash-input-google-analytics-daily/logstash-input-google-analytics-daily-1.0.0.gem
- Start Logstash with your pipeline config:
bin/logstash -f logstash.conf