Skip to content

update

Updates a context with new data.

context::update name:string, key=any,
[value=any, create_timeout=duration,
write_timeout=duration, read_timeout=duration]

The context::update operator adds new data to a specified context.

Use the key argument to specify the field in the input that should be associated with the context. The context::enrich operator uses this key to access the context. For contexts that support assigning a value with a given key, you can provide an expression to customize what’s being associated with the given key.

The three arguments create_timeout, write_timeout, and read_timeout only work with lookup tables and set the respective timeouts per table entry.

The name of the context to update.

The field that represents the enrichment key in the data.

The field that represents the enrichment value to associate with key.

Defaults to this.

Expires a context entry after a given duration since entry creation.

Expires a context entry after a given duration since the last update time. Every Every call to context::update resets the timeout for the respective key.

Expires a context entry after a given duration since the last access time. Every call to context::enrich resets the timeout for the respective key.

Create a lookup table:

context::create_lookup_table "ctx"

Add data to the lookup table via context::update:

from {x:1, y:"a"},
{x:2, y:"b"}
context::update "ctx", key=x, value=y

Retrieve the lookup table contents:

context::inspect "ctx"
{key: 2, value: "b"}
{key: 1, value: "a"}
from {x:1},
{x:2}
context::update "ctx", key=x, value=x*x
{key: 2, value: 4}
{key: 1, value: 1}

context::create_bloom_filter, context::create_geoip, context::create_lookup_table, context::enrich, context::erase, context::inspect, context::list, context::load, context::remove, context::reset, context::save