{"id":21056948,"url":"https://github.com/fluent-plugins-nursery/fluent-plugin-map","last_synced_at":"2025-05-15T23:33:34.378Z","repository":{"id":3875252,"uuid":"4961574","full_name":"fluent-plugins-nursery/fluent-plugin-map","owner":"fluent-plugins-nursery","description":"fluent-plugin-map is the non-buffered plugin that can convert an event log to different event log(s)","archived":false,"fork":false,"pushed_at":"2021-03-11T02:38:30.000Z","size":72,"stargazers_count":14,"open_issues_count":0,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-30T08:55:05.317Z","etag":null,"topics":["fluentd","fluentd-plugin","record-manipulation"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluent-plugins-nursery.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-09T17:08:33.000Z","updated_at":"2021-03-11T02:38:33.000Z","dependencies_parsed_at":"2022-09-04T13:00:19.253Z","dependency_job_id":null,"html_url":"https://github.com/fluent-plugins-nursery/fluent-plugin-map","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent-plugins-nursery%2Ffluent-plugin-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent-plugins-nursery%2Ffluent-plugin-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent-plugins-nursery%2Ffluent-plugin-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent-plugins-nursery%2Ffluent-plugin-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluent-plugins-nursery","download_url":"https://codeload.github.com/fluent-plugins-nursery/fluent-plugin-map/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442429,"owners_count":22071864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fluentd","fluentd-plugin","record-manipulation"],"created_at":"2024-11-19T16:55:13.589Z","updated_at":"2025-05-15T23:33:29.306Z","avatar_url":"https://github.com/fluent-plugins-nursery.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fluent-plugin-map\n\n[![Build Status](https://travis-ci.org/fluent-plugins-nursery/fluent-plugin-map.svg?branch=master)](https://travis-ci.org/fluent-plugins-nursery/fluent-plugin-map)\n\nfluent-plugin-map(out\\_map) is the non-buffered plugin that can convert an event log to different event log(s)\n\n\n## Requirements\n\n| fluent-plugin-map  | fluentd | ruby |\n|-------------------|---------|------|\n| \u003e= 0.2.0 | \u003e= v0.14.0 | \u003e= 2.1 |\n|  \u003c 0.2.0 | \u003e= v0.12.0 | \u003e= 1.9 |\n\n## MapFilter\n\n### Configuration\n\n| parameter | description                                                                                                                                            | default |\n|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| map       | Specify rule to convert an event log                                                                                                                   | nil     |\n| time      | Specify rule to convert a time. The format of time is an integer number of seconds since the Epoch                                                     | nil     |\n| record    | Specify rule to convert a record.The format of record is hash.                                                                                         | nil     |\n| multi     | Enable to output multi logs                                                                                                                            | `false` |\n| timeout   | Specify timeout                                                                                                                                        | `1`     |\n| format    | Specify format. If `map` is specified, the format is `map`. If `time` and `record` is specified, the format is `record`. (`map`, `record`, `multimap`) | nil     |\n\n### Example\n\nThis sample config filter code file and time file.\n\n    \u003csource\u003e\n      @type tail\n      format apache\n      path /var/log/httpd-access.log\n      tag tag\n      @label @raw\n    \u003c/source\u003e\n    \u003clabel @raw\u003e\n      \u003cmatch **\u003e\n        @type copy\n        \u003cstore\u003e\n          @type relabel\n          @label @code\n        \u003c/store\u003e\n        \u003cstore\u003e\n          @type relabel\n          @label @time\n        \u003c/store\u003e\n      \u003c/match\u003e\n    \u003c/label\u003e\n    \u003clabel @code\u003e\n      \u003cfilter **\u003e\n        @type map\n        map ([time, {\"code\" =\u003e record[\"code\"].to_i}])\n      \u003c/filter\u003e\n      \u003cmatch **\u003e\n        @type file\n        path code.log\n      \u003c/match\u003e\n    \u003c/label\u003e\n    \u003clabel @time\u003e\n      \u003cfilter **\u003e\n        @type map\n        map ([time, {\"time\" =\u003e record[\"time\"].to_i}])\n      \u003c/filter\u003e\n      \u003cmatch **\u003e\n        @type file\n        path time.log\n      \u003c/match\u003e\n    \u003c/label\u003e\n\n\nThe parameter \"map\" can use 2 variables in event log; time, record. The format of time is an integer number of seconds since the Epoch. The format of record is hash.\nThe config file parses # as the begin of comment. So the \"map\" value cannot use #{tag} operation.\nThis plugin can output multi logs by seting multi to true.\n\nIf you don't use multi option, you can use time, record parameter. The 2 following filter directive is same:\n\n    \u003cfilter tag\u003e\n      @type map\n      map ([time, {\"code\" =\u003e record[\"code\"].to_i}])\n    \u003c/filter\u003e\n    \u003cfilter tag\u003e\n      @type map\n      time time\n      record ({\"code\" =\u003e record[\"code\"].to_i})\n    \u003c/filter\u003e\n\n## MapOutput\n\n### Configuration\n\n\n| parameter | description                                                                                                                                                      | default |\n|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| map       | Specify rule to convert an event log                                                                                                                             | nil     |\n| time      | Specify rule to convert a time. The format of time is an integer number of seconds since the Epoch                                                               | nil     |\n| record    | Specify rule to convert a record.The format of record is hash.                                                                                                   | nil     |\n| multi     | Enable to output multi logs                                                                                                                                      | `false` |\n| timeout   | Specify timeout                                                                                                                                                  | `1`     |\n| format    | Specify format. If `map` is specified, the format is `map`. If `time` and `record` and (`tag` or `key`) are specified, the format is `record`. (`map`, `record`) | nil     |\n| key       | Specify the key in record. This parameter is deprecated.                                                                                                         | nil     |\n| tag       | Specify the tag in record                                                                                                                                        | nil     |\n\n### Example\n\nThis sample config output code file and time file.\n\n    \u003csource\u003e\n      @type tail\n      format apache\n      path /var/log/httpd-access.log\n      tag tag\n    \u003c/source\u003e\n    \u003cmatch tag\u003e\n      @type map\n      map ([[\"code.\" + tag, time, {\"code\" =\u003e record[\"code\"].to_i}], [\"time.\" + tag, time, {\"time\" =\u003e record[\"time\"].to_i}]])\n      multi true\n    \u003c/match\u003e\n    \u003cmatch code.tag\u003e\n      @type file\n      path code.log\n    \u003c/match\u003e\n    \u003cmatch time.tag\u003e\n      @type file\n      path time.log\n    \u003c/match\u003e\n\n\nThe parameter \"map\" can use 3 variables in event log; tag, time, record. The format of time is an integer number of seconds since the Epoch. The format of record is hash.\nThe config file parses # as the begin of comment. So the \"map\" value cannot use #{tag} operation.\nThis plugin can output multi logs by seting multi to true.\n\nIf you don't use multi option, you can use key, time, record parameter. The 2 following match directive is same:\n\n    \u003cmatch tag\u003e\n      @type map\n      map ([\"code.\" + tag, time, {\"code\" =\u003e record[\"code\"].to_i}])\n    \u003c/match\u003e\n    \u003cmatch tag\u003e\n      @type map\n      tag (\"code.\" + tag)\n      time time\n      record ({\"code\" =\u003e record[\"code\"].to_i})\n    \u003c/match\u003e\n\n\n## Note\n\nyou have to wrap some configuration values with parenthesis like `(\"code.\" + tag)`, to avoid parsing by Fluentd itself.\nSee also: [Config File Syntax - Fluentd](https://docs.fluentd.org/configuration/config-file#format-tips)\n\n## Copyright\n\n* Copyright (c) 2015- Tomita Kohei\n* Apache License, Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluent-plugins-nursery%2Ffluent-plugin-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluent-plugins-nursery%2Ffluent-plugin-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluent-plugins-nursery%2Ffluent-plugin-map/lists"}