{"action":"created","issue":{"url":"https://api.github.com/repos/uken/fluent-plugin-elasticsearch/issues/495","repository_url":"https://api.github.com/repos/uken/fluent-plugin-elasticsearch","labels_url":"https://api.github.com/repos/uken/fluent-plugin-elasticsearch/issues/495/labels{/name}","comments_url":"https://api.github.com/repos/uken/fluent-plugin-elasticsearch/issues/495/comments","events_url":"https://api.github.com/repos/uken/fluent-plugin-elasticsearch/issues/495/events","html_url":"https://github.com/uken/fluent-plugin-elasticsearch/issues/495","id":375602382,"node_id":"MDU6SXNzdWUzNzU2MDIzODI=","number":495,"title":"Type_name dynamic ","user":{"login":"Nafer17","id":24899475,"node_id":"MDQ6VXNlcjI0ODk5NDc1","avatar_url":"https://avatars2.githubusercontent.com/u/24899475?v=4","gravatar_id":"","url":"https://api.github.com/users/Nafer17","html_url":"https://github.com/Nafer17","followers_url":"https://api.github.com/users/Nafer17/followers","following_url":"https://api.github.com/users/Nafer17/following{/other_user}","gists_url":"https://api.github.com/users/Nafer17/gists{/gist_id}","starred_url":"https://api.github.com/users/Nafer17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nafer17/subscriptions","organizations_url":"https://api.github.com/users/Nafer17/orgs","repos_url":"https://api.github.com/users/Nafer17/repos","events_url":"https://api.github.com/users/Nafer17/events{/privacy}","received_events_url":"https://api.github.com/users/Nafer17/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-30T17:15:58Z","updated_at":"2018-10-31T07:54:12Z","closed_at":null,"author_association":"NONE","body":"I want to have different type according to a field of my records.\r\n\r\nThe issue is that elasticsearch seems to create a mapping only for the first record it receives but I want to record all my logs in the same index everyday but in different types.\r\n\r\nHere is my code, if someone can help me.\r\nThank's.\r\n\r\n\r\n```\r\n<source>\r\n  @type syslog\r\n  port 5140\r\n  bind 0.0.0.0\r\n  tag filter\r\n  source_hostname_key \"ip_host\"\r\n  priority_key \"priority\"\r\n  facility_key \"facilityLevel\"\r\n\r\n  <parse>\r\n    name syslog\r\n    @type regexp\r\n    expression /^(?<syslogTime>[^ ]* {1,2}[^ ]* [^ ]*) (?<host>[^ ]*) (?<ident>[a-zA-Z0-9_\\/\\.\\-]*)(?:\\[(?<pid>[0-9]+)\\])?(?:[^\\:]*\\:)? (?<error>[a-zA-Z0-9_]*)?(?:[^\\:]*\\:)? *(?<message>.*)$/\r\n    time_key syslogTime\r\n    time_format \"%b %d %H:%M:%S\"\r\n    time_type string\r\n    keep_time_key \"true\"\r\n    types syslogTime:time:%b %d %H:%M:%S\r\n    include_tag_key \"true\"\r\n  </parse>\r\n\r\n</source>\r\n\r\n<match filter.**>\r\n  @type elasticsearch_dynamic\r\n  hosts xxxx\r\n\r\n  <buffer>\r\n    type memory\r\n    flush_interval 10s\r\n    queue_limit_length 1024\r\n    flush_thread_count 16\r\n  </buffer>\r\n\r\n  type_name fluentd_${record['error']}\r\n  index_name junos_log_${Time.new(Time.now.year, Time.now.month, Time.now.day).to_i.to_s}\r\n</match>\r\n```"},"comment":{"url":"https://api.github.com/repos/uken/fluent-plugin-elasticsearch/issues/comments/434593057","html_url":"https://github.com/uken/fluent-plugin-elasticsearch/issues/495#issuecomment-434593057","issue_url":"https://api.github.com/repos/uken/fluent-plugin-elasticsearch/issues/495","id":434593057,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDU5MzA1Nw==","user":{"login":"Nafer17","id":24899475,"node_id":"MDQ6VXNlcjI0ODk5NDc1","avatar_url":"https://avatars2.githubusercontent.com/u/24899475?v=4","gravatar_id":"","url":"https://api.github.com/users/Nafer17","html_url":"https://github.com/Nafer17","followers_url":"https://api.github.com/users/Nafer17/followers","following_url":"https://api.github.com/users/Nafer17/following{/other_user}","gists_url":"https://api.github.com/users/Nafer17/gists{/gist_id}","starred_url":"https://api.github.com/users/Nafer17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nafer17/subscriptions","organizations_url":"https://api.github.com/users/Nafer17/orgs","repos_url":"https://api.github.com/users/Nafer17/repos","events_url":"https://api.github.com/users/Nafer17/events{/privacy}","received_events_url":"https://api.github.com/users/Nafer17/received_events","type":"User","site_admin":false},"created_at":"2018-10-31T07:54:12Z","updated_at":"2018-10-31T07:54:12Z","author_association":"NONE","body":"I'm using td-agent version 0.16.1, elasticsearch v 6.4.0 and fluent-plugin-elasticsearch 2.10.3"}}
{"actor":{"display_login":"Nafer17"}}