AppenderElasticSearch: Log to ElasticSearch

AppenderElasticSearchR Documentation

Log to ElasticSearch

Description

Log to ElasticSearch via HTTP

Details

NOTE: Experimental; not yet fully documented and and details are subject to change

Value

The ⁠$new()⁠ method returns an R6::R6 that inherits from lgr::Appender and can be uses as an appender by a lgr::Logger.

Super classes

lgr::Filterable -> lgr::Appender -> lgr::AppenderMemory -> AppenderElasticSearch

Active bindings

conn

a ElasticSearch connection

index

target ElasticSearch index. May either be:

  • a character scalar, or

  • a function returning a character scalar

index_create_body

Methods

Public methods

Inherited methods

Method new()

Usage
AppenderElasticSearch$new(
  conn,
  index,
  threshold = NA_integer_,
  layout = LayoutElasticSearch$new(),
  index_create_body = NULL,
  buffer_size = 0,
  flush_threshold = "error",
  flush_on_exit = TRUE,
  flush_on_rotate = TRUE,
  should_flush = NULL,
  filters = NULL
)
Arguments
conn, index

see section Fields

threshold, flush_threshold, layout, buffer_size

see lgr::AppenderBuffer A data data.frame. content of index


Method set_conn()

Usage
AppenderElasticSearch$set_conn(conn)

Method get_data()

Usage
AppenderElasticSearch$get_data(
  n = 20L,
  threshold = NA,
  result_type = "data.frame"
)
Arguments
n

integer scalar. Retrieve only the last n log entries that match threshold

threshold

character or integer scalar. The minimum log level that should be displayed

result_type

character scalar. Any of:

  • data.frame

  • data.table (shortcut: dt)

  • list (unprocessed list with ElasticSearch metadata)

  • json (raw ElasticSearch JSON)

Returns

see result_type


Method show()

Usage
AppenderElasticSearch$show(threshold = NA_integer_, n = 20)

Method flush()

Usage
AppenderElasticSearch$flush()

See Also

Other Appenders: AppenderDbi, AppenderDt, AppenderGmail, AppenderPushbullet, AppenderSendmail, AppenderSyslog


s-fleck/lgrExtra documentation built on Sept. 4, 2024, 2:39 a.m.