GithubHelp home page GithubHelp logo

logstash-input-google-analytics-daily's Introduction

Logstash Plugin

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

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,

Developing

1. Plugin Development and Testing

Code

  • To get started, you'll need JRuby with the Bundler gem installed (jruby -S gem install bundler).

  • Install dependencies

jruby -S bundle install

Test

  • Run tests
jruby -S bundle exec rspec

Running your plugin locally in Logstash

Linking the gem

  • 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.

2.2 Run in an installed 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

logstash-input-google-analytics-daily's People

Contributors

russorat avatar shalvah avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.