{"id":1445,"date":"2015-02-16T12:59:22","date_gmt":"2015-02-16T04:59:22","guid":{"rendered":"https:\/\/cowmanchiang.me\/wp\/?p=1445"},"modified":"2023-10-31T15:43:50","modified_gmt":"2023-10-31T07:43:50","slug":"logstash-pattern-set-in-grok","status":"publish","type":"post","link":"https:\/\/cowmanchiang.me\/wp\/?p=1445","title":{"rendered":"[Logstash] Pattern set in grok."},"content":{"rendered":"<p>The original warning message is this.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\">&quot;You are using a deprecated config setting &quot;pattern&quot; set in grok. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. You should use this instead: match =&gt; { &quot;message&quot; =&gt; &quot;your pattern here&quot; } If you have any questions about this, please visit the #logstash channel on freenode irc.&quot;&quot;<\/pre>\n<p>And here is the original server config.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\">if [type] == &quot;nginx-access&quot; {\n  grok {\n    type =&gt; &quot;nginx-access&quot;\n    pattern =&gt; &quot;%{NGINXACCESS}&quot;\n    patterns_dir =&gt; [&quot;\/opt\/logstash\/patterns&quot;]\n  }\n}<\/pre>\n<p>So what we should do is modify the config. Using the match function to replace the pattern, like this.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\">if [type] == &quot;nginx-access&quot; {\n  grok {\n    patterns_dir =&gt; &quot;\/opt\/logstash\/patterns&quot;\n    type =&gt; &quot;nginx-access&quot;\n    match =&gt; [&quot;message&quot;, &quot;%{NGINXACCESS}&quot;]\n  }\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The original warning message is this. &quot;You are using a deprecated config setting &quot;pattern&quot; set in grok. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. You should use this instead: match =&gt; &hellip; <a href=\"https:\/\/cowmanchiang.me\/wp\/?p=1445\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59],"tags":[],"class_list":["post-1445","post","type-post","status-publish","format-standard","hentry","category-logstash"],"_links":{"self":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1445"}],"version-history":[{"count":1,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1445\/revisions"}],"predecessor-version":[{"id":1931,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1445\/revisions\/1931"}],"wp:attachment":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}