2025-03-16 11:53AM
1. 确保Elasticsearch容器正在运行
$ docker ps | grep elasticsearch
如果容器未运行,先启动它
$ docker start elasticsearch
2. 使用curl命令插入单条数据
my_index
curl -X POST "http://localhost:9200/my_index/_doc" -H 'Content-Type: application/json' -d'
{
"message": "This is a test log",
"level": "INFO",
"timestamp": "2023-10-01T12:00:00"
}'
登录
请登录后再发表评论。
评论列表:
目前还没有人发表评论