<commit_before>require "fluent/plugin/parser_multiline"

class Fluentd
  module Setting
    class InTail
      include Fluentd::Setting::Plugin

      register_plugin("input", "tail")
      # TODO support formatN ???

      MULTI_LINE_MAX_FORMAT_COUNT = ::Fluent::Plugin::MultilineParser::FORMAT_MAX_NUM


      def guess_format
        case path
        when /\.json$/
          :json
        when /\.csv$/
          :csv
        when /\.tsv$/
          :tsv
        when /\.ltsv$/
          :ltsv
        when /nginx/
          :nginx
        when /apache/
          :apache2
        when %r|/var/log|
          :syslog
        else
          :regexp
        end
      end

      def extra_format_options<commit_msg>Rename guess_format -> guess_parse_type<commit_after>require "fluent/plugin/parser_multiline"

class Fluentd
  module Setting
    class InTail
      include Fluentd::Setting::Plugin

      register_plugin("input", "tail")
      # TODO support formatN ???

      MULTI_LINE_MAX_FORMAT_COUNT = ::Fluent::Plugin::MultilineParser::FORMAT_MAX_NUM

      def guess_parse_type
        case path
        when /\.json$/
          :json
        when /\.csv$/
          :csv
        when /\.tsv$/
          :tsv
        when /\.ltsv$/
          :ltsv
        when /nginx/
          :nginx
        when /apache/
          :apache2
        when %r|/var/log|
          :syslog
        else
          :regexp
        end
      end

      def extra_format_options
{'fraction_non_alphanumeric': 0.09419795221843004, 'fraction_numerical': 0.0013651877133105802, 'mean_word_length': 1.5275862068965518, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3088700', 'n_tokens_mistral': 474, 'n_tokens_neox': 442, 'n_words': 97}