diff --git a/app/views/shared/vue/_in_tail_format.html.erb b/app/views/shared/vue/_in_tail_format.html.erb index 483dff7..9362b37 100644 --- a/app/views/shared/vue/_in_tail_format.html.erb +++ b/app/views/shared/vue/_in_tail_format.html.erb @@ -27,7 +27,9 @@
{{{ highlightedLines }}}- TODO: grok reference +
+ Grok syntax, for example, %{INT:foo}
pattern given then translate to /(?<foo>(?:[+-]?(?:[0-9]+)))/
regexp.
+
+ Available key/value are here. +
+ +
+ Nov 29 17:02:55 MacBook-Pro-2.local UserEventAgent[239] : cannot find fw daemon port 1102
the log you have,
+ %{MONTH:month}%{SPACE}%{MONTHDAY:day} %{TIME:time} %{DATA} \[%{INT:pid}\]
for matching that, you will gain following result.
+
Key | +Value | +
---|---|
month | Nov | +
day | 29 | +
time | 17:02:55 | +
pid | 239 | +
+ Grokの記法が使えます。例えば%{INT:foo}
とすると、/(?<foo>(?:[+-]?(?:[0-9]+)))/
という正規表現に変換されます。
+
+ 使えるキー・値についてはリファレンスをご確認ください。 +
++
Nov 29 17:02:55 MacBook-Pro-2.local UserEventAgent[239] : cannot find fw daemon port 1102
というログに対し、%{MONTH:month}%{SPACE}%{MONTHDAY:day} %{TIME:time} %{DATA} \[%{INT:pid}\]
というパターンを適用すると以下の結果が得られます。
+
+ キー名 | +値 | +
---|---|
month | Nov | +
day | 29 | +
time | 17:02:55 | +
pid | 239 | +