【curl/elastic】使用curl访问有用户名密码认证的elasticsearch服务
命令:
curl -u elastic:123456 -XGET 'localhost:9200/_cat/indices?v'
-u 后跟上用户名+“:”+密码,后面就是实际的访问指令。
示例:
[hy@localhost ~]$ curl -u elastic:123456 -XGET 'localhost:9200/_cat/indices?v' health status index uuid pri rep docs.count docs.deleted store.size pri.store.size green open .security-7 c3ozcN3FRAyYEgn2V21ypA 1 0 7 0 25.7kb 25.7kb
END