cat: Use the cat Elasticsearch api.

Description Usage Arguments Details Examples

Description

Use the cat Elasticsearch api.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cat_(parse = FALSE, ...)

cat_aliases(verbose = FALSE, index = NULL, h = NULL, help = FALSE,
  bytes = FALSE, parse = FALSE, ...)

cat_allocation(verbose = FALSE, h = NULL, help = FALSE,
  bytes = FALSE, parse = FALSE, ...)

cat_count(verbose = FALSE, index = NULL, h = NULL, help = FALSE,
  bytes = FALSE, parse = FALSE, ...)

cat_segments(verbose = FALSE, index = NULL, h = NULL, help = FALSE,
  bytes = FALSE, parse = FALSE, ...)

cat_health(verbose = FALSE, h = NULL, help = FALSE, bytes = FALSE,
  parse = FALSE, ...)

cat_indices(verbose = FALSE, index = NULL, h = NULL, help = FALSE,
  bytes = FALSE, parse = FALSE, ...)

cat_master(verbose = FALSE, index = NULL, h = NULL, help = FALSE,
  bytes = FALSE, parse = FALSE, ...)

cat_nodes(verbose = FALSE, h = NULL, help = FALSE, bytes = FALSE,
  parse = FALSE, ...)

cat_nodeattrs(verbose = FALSE, h = NULL, help = FALSE,
  bytes = FALSE, parse = FALSE, ...)

cat_pending_tasks(verbose = FALSE, h = NULL, help = FALSE,
  bytes = FALSE, parse = FALSE, ...)

cat_plugins(verbose = FALSE, h = NULL, help = FALSE, bytes = FALSE,
  parse = FALSE, ...)

cat_recovery(verbose = FALSE, index = NULL, h = NULL, help = FALSE,
  bytes = FALSE, parse = FALSE, ...)

cat_thread_pool(verbose = FALSE, index = NULL, h = NULL,
  help = FALSE, bytes = FALSE, parse = FALSE, ...)

cat_shards(verbose = FALSE, index = NULL, h = NULL, help = FALSE,
  bytes = FALSE, parse = FALSE, ...)

cat_fielddata(verbose = FALSE, index = NULL, fields = NULL,
  h = NULL, help = FALSE, bytes = FALSE, parse = FALSE, ...)

Arguments

parse

(logical) Parse to a data.frame or not. Default: FALSE

...

Curl args passed on to httr::GET()

verbose

(logical) If TRUE (default) the url call used printed to console

index

(character) Index name

h

(character) Fields to return

help

(logical) Output available columns, and their meanings

bytes

(logical) Give numbers back machine friendly. Default: FALSE

fields

(character) Fields to return, only used with fielddata

Details

See https://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html for the cat API documentation.

Note how cat_() has an underscore at the end to avoid conflict with the function base::cat() in base R.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
## Not run: 
# list Elasticsearch cat endpoints
cat_()

# Do other cat operations
cat_aliases()
cat_aliases(index='plos')
cat_allocation()
cat_allocation(verbose=TRUE)
cat_count()
cat_count(index='plos')
cat_count(index='gbif')
cat_segments()
cat_segments(index='gbif')
cat_health()
cat_indices()
cat_master()
cat_nodes()
# cat_nodeattrs() # not available in older ES versions
cat_pending_tasks()
cat_plugins()
cat_recovery(verbose=TRUE)
cat_recovery(index='gbif')
cat_thread_pool()
cat_thread_pool(verbose=TRUE)
cat_shards()
cat_fielddata()
cat_fielddata(fields='body')

# capture cat data into a data.frame
cat_(parse = TRUE)
cat_indices(parse = TRUE)
cat_indices(parse = TRUE, verbose = TRUE)
cat_count(parse = TRUE)
cat_count(parse = TRUE, verbose = TRUE)
cat_health(parse = TRUE)
cat_health(parse = TRUE, verbose = TRUE)

# Get help - what does each column mean
head(cat_indices(help = TRUE, parse = TRUE))
cat_health(help = TRUE, parse = TRUE)
head(cat_nodes(help = TRUE, parse = TRUE))

# Get back only certain fields
cat_nodes()
cat_nodes(h = c('ip','port','heapPercent','name'))
cat_nodes(h = c('id', 'ip', 'port', 'v', 'm'))
cat_indices(verbose = TRUE)
cat_indices(verbose = TRUE, h = c('index','docs.count','store.size'))

# Get back machine friendly numbers instead of the normal human friendly
cat_indices(verbose = TRUE, bytes = TRUE)

# Curl options
library("httr")
cat_count(config=verbose())

## End(Not run)

ropensci/elastic documentation built on Dec. 17, 2018, 11:08 a.m.