首页 > 解决方案 > Elasticsearch如何覆盖管道中的现有字段?

问题描述

在我的管道中,我提取了一个时间戳。我想覆盖现有的时间戳字段。我该怎么做?

管道:

{
  "description": "...",
  "processors": [
    {
      "grok": {
        "field": "message",
        "patterns": [
          "{TIMESTAMP_ISO8601:timestamp2}"
        ],
      }
    }
  ]
}

我希望timestamp2覆盖原始时间戳字段。

标签: elasticsearchkuberneteslogstashelastic-stackfilebeat

解决方案


您可以像这样简单地覆盖字段名称:

"description": "...",
"processors": [
  {
    "grok": {
      "field": "message",
      "patterns": [
        "%{TIMESTAMP_ISO8601:timestamp}"    <--- use timestamp here instead of timestamp2
      ]
    }
  }
]

推荐阅读