Skip to content

Commit

Permalink
Merge pull request #257 from fluent/drop-grok
Browse files Browse the repository at this point in the history
Remove unused grok support
  • Loading branch information
okkez authored Aug 17, 2018
2 parents a4bb511 + e8aa3ae commit 2423f65
Show file tree
Hide file tree
Showing 19 changed files with 0 additions and 470 deletions.
6 changes: 0 additions & 6 deletions app/controllers/api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ def regexp_preview
render json: { error: "#{ex.class}: #{ex.message}" }
end

def grok_to_regexp
grok = GrokConverter.new
grok.load_patterns
render text: grok.convert_to_regexp(params[:grok_str]).source
end

private

def prepare_plugin_config
Expand Down
9 changes: 0 additions & 9 deletions app/models/fluentd/setting/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ def guess_parse_type
:regexp
end
end

def grok
@grok ||=
begin
grok = GrokConverter.new
grok.load_patterns
grok
end
end
end
end
end
36 changes: 0 additions & 36 deletions config/locales/translation_en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,42 +215,6 @@ en:
notice_for_permission: "Please check permission or group setting for %{user} user can read it."
notice_for_multiline_limit: "Please input Regexp(s) separated by newline. blank lines are ignored. Lines more than 20 are dropped."
restart_from_first: Restart from first
grok_manual: |
<p>
Grok syntax, for example, <code>%{INT:foo}</code> pattern given then translate to <code>/(?&lt;foo&gt;(?:[+-]?(?:[0-9]+)))/</code> regexp.
</p>
<p>
Available key/value are <a href="http://grokdebug.herokuapp.com/patterns" target="_blank">here</a>.
</p>
<h4>Example</h4>
<p>
<code>Nov 29 17:02:55 MacBook-Pro-2.local UserEventAgent[239] : cannot find fw daemon port 1102</code> the log you have,<br />
<code>%{MONTH:month}%{SPACE}%{MONTHDAY:day} %{TIME:time} %{DATA} \[%{INT:pid}\]</code> for matching that, you will gain following result.
</p>
<table class="table">
<thead>
<tr>
<th>Key</th>
<th>Value</th>
</tr>
</thead>
<tr>
<th>month</th><td>Nov</td>
</tr>
<tr>
<th>day</th><td>29</td>
</tr>
<tr>
<th>time</th><td>17:02:55</td>
</tr>
<tr>
<th>pid</th><td>239</td>
</tr>
</table>
show:
page_title: "Choose File Path"
after_file_choose:
Expand Down
35 changes: 0 additions & 35 deletions config/locales/translation_ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,41 +221,6 @@ ja:
notice_for_multiline_limit: "改行区切りで正規表現を入力してください。空行はカウントされません。21行目以降の入力は無視されます。"
notice_for_permission: "※%{user}ユーザーが読み込み可能なようにパーミッションやグループの設定をご確認ください。"
restart_from_first: 最初からやり直す
grok_manual: |
<p>
Grokの記法が使えます。例えば<code>%{INT:foo}</code>とすると、<code>/(?&lt;foo&gt;(?:[+-]?(?:[0-9]+)))/</code>という正規表現に変換されます。
</p>
<p>
使えるキー・値については<a href="http://grokdebug.herokuapp.com/patterns" target="_blank">リファレンス</a>をご確認ください。
</p>
<p>
<h4>例</h4>
<code>Nov 29 17:02:55 MacBook-Pro-2.local UserEventAgent[239] : cannot find fw daemon port 1102</code>というログに対し、<br />
<code>%{MONTH:month}%{SPACE}%{MONTHDAY:day} %{TIME:time} %{DATA} \[%{INT:pid}\]</code>というパターンを適用すると以下の結果が得られます。
<table class="table">
<thead>
<tr>
<th>キー名</th>
<th>値</th>
</tr>
</thead>
<tr>
<th>month</th><td>Nov</td>
</tr>
<tr>
<th>day</th><td>29</td>
</tr>
<tr>
<th>time</th><td>17:02:55</td>
</tr>
<tr>
<th>pid</th><td>239</td>
</tr>
</table>
</p>
show:
page_title: "ファイル読み込み | ファイルの選択"
after_file_choose:
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
get "tree"
get "file_preview"
post "regexp_preview"
post "grok_to_regexp"

resources :settings, only: [:index, :show, :update, :destroy], defaults: { format: "json" }
resources :config_definitions, only: [:index], defaults: { format: "json" }
Expand Down
39 changes: 0 additions & 39 deletions lib/grok_converter.rb

This file was deleted.

60 changes: 0 additions & 60 deletions vendor/patterns/firewalls

This file was deleted.

94 changes: 0 additions & 94 deletions vendor/patterns/grok-patterns

This file was deleted.

Loading

0 comments on commit 2423f65

Please sign in to comment.