Skip to content
Embulk filter plugin to external ruby script
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/embulk/filter
.gitignore
Gemfile
LICENSE
README.md
embulk-filter-script.gemspec

README.md

embulk-filter-script

Embulk filter plugin to external ruby script.

Gem

Install

embulk gem install embulk-filter-script

Configuration

  • path external ruby script path (string, required)
  • drop_columns drop column names (array)

external ruby script

def filter(record)
  # This method implements the filtering logic
  record
end

Example

filters:
  - type: script
    path: ./script/example.rb
    drop_columns:
      - created_at
      - updated_at

example.rb

def filter(record)
  case record["code"].to_i
  when 100..200
    level = "INFO"
  when 201..300
    level = "WARN"
  else
    level = "ERROR"
  end
  record['message'] = "[" + level + "]" + record['message']

  record
end
You can’t perform that action at this time.