Skip to content

Extend box.cfg.audit_spaces #5649

@TarantoolBot

Description

@TarantoolBot

Since: 3.7

Each element of box.cfg.audit_spaces used to be a string representing
a space name. Now it also can be a table with the following fields:
- name - mandatory, name of the space.
- extract_key - optional, has the same semantics as option
audit_extract_key, but for particular space.

Also, space name can be a wildcard. It describes all spaces except for ones
listed in audit_log.spaces.

Example:

box.cfg({
    audit_log = 'audit.log',
    audit_format = 'csv',
    audit_filter = 'dml',
    audit_spaces = {
        {name = 'space1', extract_key = true},
        {name = 'space2', extract_key = true},
        '*' -- Enable all other spaces.
    }
})

box.schema.space.create('space1')
box.space.space1:create_index('primary')
box.schema.space.create('space2')
box.space.space2:create_index('primary')
box.schema.space.create('space3')
box.space.space3:create_index('primary')

box.space.space1:insert({1}) -- primary key is logged
box.space.space2:insert({2}) -- primary key is logged
box.space.space3:insert({3}) -- full tuple is logged

os.exit(0)

Contents of the file audit.log:

2026-04-15T12:55:24.956+0000,accd96f6-328f-4f43-99cb-903ab315ec47,VERBOSE,,background,tarantool,admin,space_insert,,Insert key [1] into space space1
2026-04-15T12:55:24.956+0000,f09b35dc-94d8-4cf4-9e35-c3ce7a4b7ca4,VERBOSE,,background,tarantool,admin,space_insert,,Insert key [2] into space space2
2026-04-15T12:55:24.956+0000,4d5e46d8-f795-49d8-8ae6-b864804f4a63,VERBOSE,,background,tarantool,admin,space_insert,,Insert tuple [3] into space space3

Requested by @drewdzzz in https://github.com/tarantool/tarantool-ee/commit/f75dbb1f0ad0babe1215ad119a35144e2cd1fbe1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions