【笔记】VictoriaLogs 单机版的测试

作者:张富春(ahfuzhang),转载时请注明作者和引用链接,谢谢!


用 docker 启动服务

docker run -it --rm --name vlogs \
	  --cpus=1 -m=512m \
	  -e GOMAXPROCS=1 \
	  -v ~/Downloads/temp/2025/VictoriaLogs/:/data/ \
	  -p 9428:9428 \
	  victoriametrics/victoria-logs:v1.38.0 \
	  -storageDataPath=/data/

浏览器查看 web ui

http://127.0.0.1:9428/select/vmui/

写入数据

echo '{"_time":"","_msg":"this is log body 8","a":"stream field a","b":"stream field b","c":"stream field c","other_tag":"xxxx"}
' | curl -X POST -H 'Content-Type: application/stream+json' --data-binary @- \
 "http://127.0.0.1:9428/insert/jsonline?_time_field=_time&_msg_field=_msg&_stream_fields=a,b,c&ignore_fields=&decolorize_fields=&AccountID=0&ProjectID=0&debug=false&extra_fields=" -v

http api

posted on 2025-11-18 16:35  ahfuzhang  阅读(3)  评论(0)    收藏  举报