{"id":375,"date":"2021-12-09T23:54:56","date_gmt":"2021-12-09T14:54:56","guid":{"rendered":"http:\/\/10.124.124.111\/?p=375"},"modified":"2021-12-10T00:00:23","modified_gmt":"2021-12-09T15:00:23","slug":"fluentd%e3%81%a7%e9%96%be%e5%80%a4%e3%81%a8%e5%a4%a7%e5%b0%8f%e6%af%94%e8%bc%83%e3%81%99%e3%82%8bfilterplugin%e3%82%92%e6%9b%b8%e3%81%84%e3%81%9f","status":"publish","type":"post","link":"https:\/\/blog.homi.run\/?p=375","title":{"rendered":"Fluentd\u3067\u95be\u5024\u3068\u5927\u5c0f\u6bd4\u8f03\u3057\u3066\u62bd\u51fa\u3059\u308bFilterPlugin\u3092\u66f8\u3044\u305f"},"content":{"rendered":"\n<p>Fluentd\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u81ea\u4f5c\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\u306e\u3067\u516c\u958b\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">fluent-plugin-num-comparison<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/github.com\/homirun\/fluent-plugin-num-comparison\"><img decoding=\"async\" src=\"https:\/\/gh-card.dev\/repos\/homirun\/fluent-plugin-num-comparison.svg\" alt=\"homirun\/fluent-plugin-num-comparison - GitHub\"\/><\/a><\/figure>\n\n\n\n<p>\u3053\u306eFilter\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3046\u3053\u3068\u3067\u4e8b\u524d\u306b\u6307\u5b9a\u3057\u305f\u95be\u5024\u3068record\u306e\u30ad\u30fc\u306e\u5024\u3092\u6bd4\u8f03\u3057\u3066\u5927\u304d\u3044\u3001\u3082\u3057\u304f\u306f\u5c0f\u3055\u3044\u3082\u306e\u3060\u3051\u3092\u62bd\u51fa\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<p>\u81ea\u5206\u306e\u8abf\u67fb\u4e0d\u8db3\u306e\u53ef\u80fd\u6027\u3082\u3042\u308b\u304c\u3001\u610f\u5916\u3068\u3053\u3046\u3044\u3046\u6319\u52d5\u3092\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u898b\u5f53\u305f\u3089\u306a\u304b\u3063\u305f\u3002<\/p>\n\n\n\n<p>(\u305d\u3082\u305d\u3082Fluentd\u306b\u3084\u3089\u305b\u308b\u3053\u3068\u3067\u306f\u306a\u3044\u306e\u304b\u3082\u3057\u308c\u306a\u3044\u304c\u3002)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installation<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>$ gem install fluent-plugin-num-comparison<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Example<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Input<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>{\"access_count\": 29}\n{\"access_count\": 30}\n{\"access_count\": 31}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Config<\/h4>\n\n\n\n<p><code>record_key<\/code>\u306b\u306f\u6bd4\u8f03\u3057\u305f\u3044\u5024\u306eKey\u3001<code>threshold<\/code>\u306b\u306f\u95be\u5024\u3001<code>inequality<\/code>\u306b\u306f\u95be\u5024\u3088\u308a\u5927\u304d\u3044\u3082\u306e(<code>larger<\/code>)\u304b\u5c0f\u3055\u3044\u3082\u306e(<code>smaller<\/code>)\u306e\u3069\u3061\u3089\u3092<strong>\u62bd\u51fa<\/strong>\u3057\u305f\u3044\u304b\u3092\u6307\u5b9a\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;filter test&gt;\n  @type num_comparison\n  record_key access_count\n  threshold 30\n  inequality larger\n&lt;\/filter&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Output<\/h4>\n\n\n\n<p>\u3053\u306e\u4f8b\u3067\u306f<strong>\u95be\u5024\u3067\u3042\u308b30\u3088\u308a\u3082\u5927\u304d\u3044\u3082\u306e\u3092\u62bd\u51fa\u3059\u308b<\/strong>\u3068\u3044\u3046\u6761\u4ef6\u3060\u3063\u305f\u305f\u3081access_count\u304c29\u300130\u3060\u3063\u305frecord\u306f\u524a\u9664\u3055\u308c\u300131\u306erecord\u3060\u3051\u304c\u51fa\u529b\u3055\u308c\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\"access_count\": 31}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u3055\u3044\u3054\u306b<\/h2>\n\n\n\n<p>\u4eca\u56de\u3001\u521d\u3081\u3066\u306eFluentdPlugin\u4f5c\u6210 and gem\u4f5c\u6210\u3092\u3057\u3066\u307f\u305f\u3002<\/p>\n\n\n\n<p>\u9014\u4e2d\u3001\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306e\u96db\u5f62\u3068\u3057\u3066\u751f\u6210\u3055\u308c\u305f\u306e\u304cminitest\u3067\u3082RSpec\u3067\u3082\u7121\u304f\u3066test-unit\u3068\u3044\u3046\u3082\u306e\u3067\u56f0\u60d1\u3057\u305f\u308a\u3001\u81ea\u5206\u306e\u500b\u4eba\u30ea\u30dd\u30b8\u30c8\u30ea\u3067\u306f\u521d\u306eGitHubActions\u3082\u5c0e\u5165\u3057\u305f\u304f\u306a\u3063\u305f\u308a\u3057\u305f\u304c\u3001<a href=\"https:\/\/tech.pepabo.com\/2021\/09\/21\/newbie-training-2021\/\" title=\"https:\/\/tech.pepabo.com\/2021\/09\/21\/newbie-training-2021\/\">\u65b0\u5352\u7814\u4fee<\/a>\u306a\u3069\u306e\u304a\u304b\u3052\u3067\u6848\u5916\u30b7\u30e5\u30c3\u3068\u3067\u304d\u305f\u3002<\/p>\n\n\n\n<p>Ruby\u3082Fluentd\u3082\u82f1\u8a9e\u3082(DeepL\u306b\u3076\u3093\u6295\u3052\u305f)\u521d\u5fc3\u8005\u306a\u306e\u3067\u30b3\u30fc\u30c9\u3084README\u304c\u304a\u304b\u3057\u304b\u3063\u305f\u3089\u305c\u3072PR\u6295\u3052\u3066\u3082\u3089\u3048\u308b\u3068\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fluentd\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u81ea\u4f5c\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\u306e\u3067\u516c\u958b\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u305f\u3002 fluent-plugin-num-comparison \u3053\u306eFilter\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3046\u3053\u3068\u3067\u4e8b\u524d\u306b\u6307\u5b9a\u3057\u305f\u95be\u5024\u3068record\u306e\u30ad\u30fc\u306e\u5024\u3092\u6bd4 &hellip; <a href=\"https:\/\/blog.homi.run\/?p=375\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Fluentd\u3067\u95be\u5024\u3068\u5927\u5c0f\u6bd4\u8f03\u3057\u3066\u62bd\u51fa\u3059\u308bFilterPlugin\u3092\u66f8\u3044\u305f&#8221;\u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7],"tags":[9],"class_list":["post-375","post","type-post","status-publish","format-standard","hentry","category-6","category-7","tag-fluentd"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/posts\/375","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.homi.run\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=375"}],"version-history":[{"count":18,"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/posts\/375\/revisions"}],"predecessor-version":[{"id":394,"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/posts\/375\/revisions\/394"}],"wp:attachment":[{"href":"https:\/\/blog.homi.run\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.homi.run\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.homi.run\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}