Sha256: cf2ac4eb852693fd834f8719ae1b9010708fbdd09a5b7843a1785e75a23d6c09

Contents?: true

Size: 1.78 KB

Versions: 3

Compression:

Stored size: 1.78 KB

Contents

module Embulk
  module Guess

    # TODO implement guess plugin to make this command work:
    #      $ embulk guess -g "apache_error_log" partial-config.yml
    #
    #      Depending on the file format the plugin uses, you can use choose
    #      one of binary guess (GuessPlugin), text guess (TextGuessPlugin),
    #      or line guess (LineGuessPlugin).

    #require "embulk/parser/apache_error_log.rb"

    #class ApacheErrorLog < GuessPlugin
    #  Plugin.register_guess("apache_error_log", self)
    #
    #  def guess(config, sample_buffer)
    #    if sample_buffer[0,2] == GZIP_HEADER
    #      guessed = {}
    #      guessed["type"] = "apache_error_log"
    #      guessed["property1"] = "guessed-value"
    #      return {"parser" => guessed}
    #    else
    #      return {}
    #    end
    #  end
    #end

    #class ApacheErrorLog < TextGuessPlugin
    #  Plugin.register_guess("apache_error_log", self)
    #
    #  def guess_text(config, sample_text)
    #    js = JSON.parse(sample_text) rescue nil
    #    if js && js["mykeyword"] == "keyword"
    #      guessed = {}
    #      guessed["type"] = "apache_error_log"
    #      guessed["property1"] = "guessed-value"
    #      return {"parser" => guessed}
    #    else
    #      return {}
    #    end
    #  end
    #end

    #class ApacheErrorLog < LineGuessPlugin
    #  Plugin.register_guess("apache_error_log", self)
    #
    #  def guess_lines(config, sample_lines)
    #    all_line_matched = sample_lines.all? do |line|
    #      line =~ /mypattern/
    #    end
    #    if all_line_matched
    #      guessed = {}
    #      guessed["type"] = "apache_error_log"
    #      guessed["property1"] = "guessed-value"
    #      return {"parser" => guessed}
    #    else
    #      return {}
    #    end
    #  end
    #end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
embulk-parser-apache_error_log-0.1.2 lib/embulk/guess/apache_error_log.rb
embulk-parser-apache_error_log-0.1.1 lib/embulk/guess/apache_error_log.rb
embulk-parser-apache_error_log-0.1.0 lib/embulk/guess/apache_error_log.rb