索引模板(启用 data_stream):


PUT _index_template/logs-template
{
  "index_patterns": ["logs-*"],
  "data_stream": {},
  "template": {
    "mappings": {
      "properties": {
        "@timestamp": { "type": "date" },
        "message": { "type": "text" }
      }
    }
  }
}

创建数据流并写入:


PUT _data_stream/logs

POST /logs/_doc
{
  "@timestamp": "2025-11-26T10:00:00Z",
  "message": "service started"
}

查看数据流:


GET _data_stream/logs


点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部