How to get the full metricbeat data from the elasticsearch


(Jones Thomas) #1

i need to get the data for the metricbeat from the elasticsearch??
For example: System load,CpuUsage etc..
i need evrydata that is stored in the elasticsearch.
How can i fetch all data of metricbeat using curl command?


(David Pilato) #2
curl localhost:9200/metricbeat*/_search

If you need to absolutely download all existing data, then look at Scroll API: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html


(Jones Thomas) #3

with this command curl localhost:9200/metricbeat*/_search i get only some part of the data..i need full data,Guide me please


(David Pilato) #4

Read:


(Jones Thomas) #5

Just clarify this please :
(https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html)
POST /twitter/tweet/_search?scroll=1m
{
"size": 100,
"query": {
"match" : {
"title" : "elasticsearch"
}
}
}

instead of twiteer/tweet what should i use for metricbeat index?
i used This,

curl -XPOST 'localhost:9200/metricbeat/_search?scroll=1m&pretty' -H 'Content-Type: application/json' -d'
{
"size": 100,
"query": {
"match" : {
"title" : "elasticsearch"
}
}
}
'
only index name is enough or we should use any type to fetch all data??


(Jones Thomas) #6

i cant fetch any data :frowning:


(Jones Thomas) #7

i need to get all the data from the metricbeat..


(David Pilato) #8

Please format your code using </> icon as explained in this guide. It will make your post more readable.

Or use markdown style like:

```
CODE
```

As I said previously, use metricbeat* as the index name. It should work.


(Jones Thomas) #9

What should i use instead of “title” : “elasticsearch”, to fetch all data ??


(system) #10

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.