[elk@node01 api]$ curl http://192.168.137.2:9200/_cat/indices?v
health status index pri rep docs.count docs.deleted store.size pri.store.size
green open tlcb 5 0 0 0 795b 795b
yellow open twitter 5 1 3 0 11.3kb 11.3kb
yellow open bank 5 1 5 0 18.8kb 18.8kb
yellow open library 5 1 1 0 4.7kb 4.7kb
yellow open .marvel-es-data-1 1 1 2 0 4.2kb 4.2kb
yellow open .kibana 1 1 1 0 3.1kb 3.1kb
yellow open .marvel-kibana 5 1 1 0 4.1kb 4.1kb
yellow open czcb 5 1 0 0 795b 795b
yellow open zhou 5 1 1 0 4.5kb 4.5kb
yellow open .marvel-es-1-2017.05.28 1 1 101807 639 32.9mb 32.9mb
[elk@node01 api]$ cat a3.pl
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
$ua->agent("Mozilla/8.0");
my $host = "http://192.168.137.2:9200/_cat/indices?v";
my $response = $ua->get($host);
$ua->default_headers;
if ($response->is_success) {
print $response->decoded_content; # or whatever
}
else {
die $response->status_line;
}
[elk@node01 api]$ perl a3.pl
health status index pri rep docs.count docs.deleted store.size pri.store.size
green open tlcb 5 0 0 0 795b 795b
yellow open twitter 5 1 3 0 11.3kb 11.3kb
yellow open bank 5 1 5 0 18.8kb 18.8kb
yellow open library 5 1 1 0 4.7kb 4.7kb
yellow open .marvel-es-data-1 1 1 2 0 4.2kb 4.2kb
yellow open .kibana 1 1 1 0 3.1kb 3.1kb
yellow open .marvel-kibana 5 1 1 0 4.1kb 4.1kb
yellow open czcb 5 1 0 0 795b 795b
yellow open zhou 5 1 1 0 4.5kb 4.5kb
yellow open .marvel-es-1-2017.05.28 1 1 101935 568 32.8mb 32.8mb