Skip to content

Commit eaf6ff3

Browse files
committed
audit log: restructure the page
1 parent ebb38cd commit eaf6ff3

File tree

6 files changed

+429
-276
lines changed

6 files changed

+429
-276
lines changed
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
audit_log:
2+
to: file
3+
file: 'audit_tarantool.log'
4+
filter: [user_create,data_operations,ddl,custom]
5+
format: json
6+
spaces: [bands]
7+
extract_key: true
8+
19
groups:
210
group001:
3-
iproto:
4-
listen:
5-
- uri: '127.0.0.1:3301'
611
replicasets:
712
replicaset001:
813
instances:
914
instance001:
10-
audit_log:
11-
to: file
12-
file: 'audit_tarantool.log'
13-
filter: [ user_create,data_operations,ddl ]
14-
format: json
15-
spaces: [ bands ]
16-
extract_key: true
15+
iproto:
16+
listen:
17+
- uri: '127.0.0.1:3301'
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
-- myapp.lua --
2+
3+
-- Create space
4+
function create_space()
5+
box.schema.space.create('Bands')
6+
box.space.bands:format({
7+
{ name = 'id', type = 'unsigned' },
8+
{ name = 'band_name', type = 'string' },
9+
{ name = 'year', type = 'unsigned' }
10+
})
11+
box.space.bands:create_index('primary', { type = "tree", parts = { 'id' } })
12+
box.space.bands:create_index('secondary', { type = "tree", parts = { 'band_name' } })
13+
box.schema.user.grant('guest', 'read,write,execute', 'universe')
14+
end
15+
-- Insert data
16+
function load_data()
17+
box.space.bands:insert { 1, 'Roxette', 1986 }
18+
box.space.bands:insert { 2, 'Scorpions', 1965 }
19+
end
20+
21+
local audit = require('audit')
22+
-- Log message string
23+
audit.log('Hello, Alice!')
24+
-- Log format string and arguments
25+
audit.log('Hello, %s!', 'Bob')
26+
-- Log table with audit log field values
27+
audit.log({ type = 'custom_hello', description = 'Hello, World!' })
28+
audit.log({ type = 'custom_farewell', user = 'eve', module = 'custom', description = 'Farewell, Eve!' })
29+
-- Create a new log module
30+
local my_audit = audit.new({ type = 'custom_hello', module = 'my_module' })
31+
my_audit:log('Hello, Alice!')
32+
my_audit:log({ tag = 'admin', description = 'Hello, Bob!' })
33+
-- Log 'Hello!' message with the VERBOSE severity level
34+
audit.log({ severity = 'VERBOSE', description = 'Hello!' })
35+
36+
-- Log 'Hello!' message with a shortcut helper function
37+
audit.verbose('Hello!')
38+
39+
-- Like audit.log(), a shortcut helper function accepts a table of options
40+
audit.verbose({ description = 'Hello!' })
41+
42+
-- Severity levels are available for custom loggers
43+
local my_logger = audit.new({ module = 'my_module' })
44+
my_logger:log({ severity = 'ALARM', description = 'Alarm' })
45+
my_logger:alarm('Alarm')
46+
47+
-- Overwrite session_type and remote fields
48+
audit.log({ type = 'custom_hello', description = 'Hello!',
49+
session_type = 'my_session', remote = 'my_remote' })
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1+
audit_log:
2+
to: pipe
3+
pipe: '| cronolog audit_tarantool.log'
4+
15
groups:
26
group001:
3-
iproto:
4-
listen:
5-
- uri: '127.0.0.1:3301'
67
replicasets:
78
replicaset001:
89
instances:
910
instance001:
10-
audit_log:
11-
to: pipe
12-
pipe: 'cronolog audit_tarantool.log'
13-
format: json
14-
extract_key: false
11+
iproto:
12+
listen:
13+
- uri: '127.0.0.1:3301'
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
audit_log:
2+
to: syslog
3+
syslog_server: 'unix:/dev/log'
4+
syslog_facility: user
5+
syslog_identity: 'tarantool'
6+
filter: 'audit,auth,priv,password_change,access_denied'
7+
extract_key: false
8+
19
groups:
210
group001:
311
iproto:
@@ -7,10 +15,6 @@ groups:
715
replicaset001:
816
instances:
917
instance001:
10-
audit_log:
11-
to: syslog
12-
syslog_server: 'unix:/dev/log'
13-
syslog_facility: user
14-
syslog_identity: 'tarantool'
15-
filter: 'audit,auth,priv,password_change,access_denied'
16-
extract_key: false
18+
iproto:
19+
listen:
20+
- uri: '127.0.0.1:3301'

0 commit comments

Comments
 (0)