SlideShare a Scribd company logo
MySQL Audit
using percona audit plugin & ELK
About me
dba.kim@gmail.com
Object
3
We need
- log to MySQL connection information
- log to MySQL query log
- retrieve these logs using various search conditions
- download search results
Architecture
Percona Audit
Plugin
4
DB Servers ELK Server
logstash elasticsearch
Audit Plugin
Which audit plugin will we use? 5
Percona Audit Plugin MariaDB Audit Plugin
- support various log format(csv, json, xml)
- most of parameter can’t modify online
- support various filtering condition
(user, query type : ddl, dml, dcl)
- most of parameters can modify online
- stability issue(db crash)
https://mariadb.atlassian.net/browse/MDEV-5145
http://mysql.az/audit-mysql-no-just-crash-it/
- easy install & config
- can log at extra log file or syslog file
We chose Percona Audit Plugin
6
Percona Audit Plugin Install & Config
6
mysql>install plugin audit_log soname ‘audit_log.so’;
Ref URL : https://www.percona.com/doc/percona-server/5.5/management/audit_log_plugin.html
$/etc/init.d/mysql restart
$vi my.cnf
# Server Audit
audit_log_format = JSON
audit_log_policy = ALL
audit_log_syslog_facility = LOG_LOCAL1
audit_log_handler = SYSLOG
1. Percona Audit Plugin Install (over MySQL Ver 5.5.39) – on DB servers
2. Parameter configuration
3. MySQL restart
rsyslog config
7
1. rsyslog.conf – on DB servers
$ vi /etc/rsyslog.conf
# mysql logging
local1.* @10.xxx.xxx.xxx # ELK server ip
2. rsyslog restart
$ /etc/init.d/rsyslog restart
3. confirm log messages on syslog file
$cat messages
Jan 29 15:08:30 testdbsvr01 percona-audit: {"audit_record":{"name":"Query","record":"3683778651_1970-01-
01T00:00:00","timestamp":"2016-01-29T06:08:30
UTC","command_class":"select","connection_id":"455338789","status":0,"sqltext":"SELECT * FROM test_table
WHERE status='Done'","user":"app[app] @ [10.xxx.xxx.xxx]","host":"","os_user":"","ip":"10.xxx.xxx.xxx"}}
8
rsyslog-ng config
1. rsyslog.conf – on ELK servers
$ vi /etc/syslog-ng/syslog-ng.conf
source s_sys {
file ("/proc/kmsg" program_override("kernel: "));
unix-stream ("/dev/log");
internal();
udp(ip(0.0.0.0) port(514)); ## uncomment this line
};
destination d_myaudit { file("/var/log/myaudit/myaudit.${HOST}.${YEAR}-${MONTH}-${DAY}.log" create-dirs(yes) dir-perm(0755) perm(0644) ); };
filter f_myaudit { facility(local1); };
log { source(s_sys); filter(f_myaudit); destination(d_myaudit); };
2. syslog-ng restart
$ /etc/init.d/syslog-ng restart
Install ELK
Elasticsearch 9
1. elasticsearch install – on ELK server
$ yum install elasticsearch
2. configuration
$ vi /etc/elasticsearch/elasticsearch.yml
cluster.name : my_cluster # cluster name
node.name : my_node01 # node name
network.host : 10.xxx.xxx.xxx # server’s ip
You can download from
https://www.elastic.co/downloads/elasticsearch.
It needs a recent version of java before install elasticsearch.
Install ELK
Elasticsearch 10
3. start elasticsearch
$/etc/init.d/elasticsearch start
4. Head plugin install
$cd /usr/share/elasticsearch/bin
$./plugin install mobz/elasticsearch-head
5. Check plugin install
http://10.xxx.xxx.xxx:9200/_plugin/head/
1111
Install ELK
Logstash 11
1. Install Logstash – on ELK server
$ rpm –ivh logstash-2.1.1-1.noarch.rpm
2-1. Configure ( input plugin )
$ sudo vi /etc/logstash/conf.d/01-myaudit-input.conf
input {
file {
type => "myaudit"
path => ["/var/log/myaudit/*.log"]
start_position => "beginning"
codec => 'json'
}
}
You can download from
https://www.elastic.co/downloads/logstash
12
Install ELK
Logstash
2-2. Configure ( filter plugin )
$ sudo vi /etc/logstash/conf.d/10-myaudit.conf
filter {
grok {
match => { "message" =>
"%{SYSLOGTIMESTAMP:sys_timestamp}%{SPACE}%{HOSTNAME:host_name}
%{SPACE} percona-audit: %{GREEDYDATA:json_data}"}
}
json {
source => "json_data"
}
}
13
Install ELK
Logstash
2-3. Configure ( output plugin )
$ sudo vi /etc/logstash/conf.d/30-elasticsearch-output.conf
output {
elasticsearch {
hosts => "10.xxx.xxx.xxx"
}
}
3. Start logstash
$ sudo /etc/init.d/logstash start
14
Install ELK
Kibana 14
1. Kibana install – on ELK server
$ tar –xvf kibana-4.3.1-linux-x64.tar.gz
2. configuration
$ vi ./config/kibana.yml
host: “10.xxx.xxx.xxx” # kibana server ip
elasticsearch_url: “http://10.xxx.xxx.xxx:9200” # elasticsearch server ip
4. Check
You can download from
https://www.elastic.co/downloads/kibana
http://10.xxx.xxx.xxx:5601
3. Start Kibana
$ ./bin/kibana
It needs a space between “host:” and IP.
15
Install ELK
Kibana
5. Config an index pattern
16
Make Kibana Dashboard
http://10.xxx.xxx.xxx:5601
Search condition create(1/3) 17
Make Kibana Dashboard
1
2
Search condition create(2/3) 18
Make Kibana Dashboard
3
4
19
Search condition create(3/3)
Make Kibana Dashboard
5
6
20
1
Make Graph: line chart(1/6)
Make Kibana Dashboard
21
2
Make Kibana Dashboard
Make Graph: line chart(2/6)
22
3
4
Make Kibana Dashboard
Make Graph: line chart(3/6)
23
5
6
Make Kibana Dashboard
Make Graph: line chart(4/6)
24
7
8
Make Kibana Dashboard
Make Graph: line chart(5/6)
25
9
Make Kibana Dashboard
Make Graph: line chart(6/6)
26
Make Kibana Dashboard
Make Graph: Pie chart(1/4)
1
27
Make Kibana Dashboard
Make Graph: Pie chart(2/4)
2
28
Make Kibana Dashboard
Make Graph: Pie chart(3/4)
3
4
29
Make Kibana Dashboard
Make Graph: Pie chart(4/4)
5
30
Make Kibana Dashboard
Markdown widget(1/3)
1
31
Make Kibana Dashboard
Markdown widget(2/3)
1
###Menu: // label, the number of “#” determines a size of character.
[Main]: //label
(/#dashboard/Main): // link dashboard. “Main” is name of dashboard.
You have to make dashboard before markdown widget.
2
32
Make Kibana Dashboard
Markdown widget(3/3)
3
33
Make Dashboard
Make Kibana Dashboard
1
34
2
Make Dashboard
Make Kibana Dashboard
35
3
4
Make Dashboard
Make Kibana Dashboard
Dashboard-sample
36
Markdown widget
Line chart
Search condition
Dashboard-sample
37
Markdown widget
Pie chart
Elasticsearch Plugin – Head(1/2)
38
http://10.xxx.xxx.xxx:9200/_plugin/head/
1
2
3
4
search query
Elasticsearch Plugin – Head(2/2)
39
{
"_source": [
"@timestamp",
"host_name", "audit_record.user", "audit_record.sqltext", "audit_record.name" ],
"sort": { "@timestamp": "asc" },
"size": 100,
"query": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"gte": "2016-01-16T00:00:00.000",
"lte": "2016-01-16T02:59:59.999" }
} },
{"term": { "host_name": “host_name123" } },
{"term": { "audit_record.name": "query"} }
] } }}
Search condition of string type uses a lower character
only.
ex) “audit_record.name”:”Query” (x)
“audit_record.name”:”query” (o)
Thank You

More Related Content

PPTX
PostgreSQL Database Slides
PDF
Redo log improvements MYSQL 8.0
PDF
EDB Postgres DBA Best Practices
 
PDF
MySQL 8.0.16 New Features Summary
PDF
Complete Guide for Linux shell programming
PDF
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
PDF
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
PDF
Introduction to Apache Hive
PostgreSQL Database Slides
Redo log improvements MYSQL 8.0
EDB Postgres DBA Best Practices
 
MySQL 8.0.16 New Features Summary
Complete Guide for Linux shell programming
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Introduction to Apache Hive

What's hot (20)

PDF
Postgresql tutorial
PDF
Postgresql database administration volume 1
PDF
Ansible
PDF
Ansible Automation Platform.pdf
PDF
Backup and-recovery2
PDF
MariaDB Performance Tuning and Optimization
PPTX
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
POTX
IBM Domino / IBM Notes Performance Tuning
PDF
MongodB Internals
PDF
What is new in PostgreSQL 14?
PPTX
MySQL Slow Query log Monitoring using Beats & ELK
PPTX
In-memory Databases
PDF
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
ODP
PostgreSQL Administration for System Administrators
PDF
PostgreSQL for Oracle Developers and DBA's
PDF
Oracle 12c PDB insights
PDF
ProxySQL High Avalability and Configuration Management Overview
PPTX
From cache to in-memory data grid. Introduction to Hazelcast.
PDF
My First 100 days with an Exadata (PPT)
PPT
Memcache
Postgresql tutorial
Postgresql database administration volume 1
Ansible
Ansible Automation Platform.pdf
Backup and-recovery2
MariaDB Performance Tuning and Optimization
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
IBM Domino / IBM Notes Performance Tuning
MongodB Internals
What is new in PostgreSQL 14?
MySQL Slow Query log Monitoring using Beats & ELK
In-memory Databases
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
PostgreSQL Administration for System Administrators
PostgreSQL for Oracle Developers and DBA's
Oracle 12c PDB insights
ProxySQL High Avalability and Configuration Management Overview
From cache to in-memory data grid. Introduction to Hazelcast.
My First 100 days with an Exadata (PPT)
Memcache
Ad

Viewers also liked (20)

PPTX
Attack monitoring using ElasticSearch Logstash and Kibana
PPTX
MySQL Monitoring using Prometheus & Grafana
PPT
Understanding MySQL Performance through Benchmarking
PDF
"How about no grep and zabbix?". ELK based alerts and metrics.
PDF
Real-time data analysis using ELK
PPTX
ELK Ruminating on Logs (Zendcon 2016)
PPTX
Using ELK-Stack (Elasticsearch, Logstash and Kibana) with BizTalk Server
PPTX
Elk stack
PPTX
ELK at LinkedIn - Kafka, scaling, lessons learned
PDF
Webinar - Centralising syslogs with the new beats, logstash and elasticsearch
ODP
MySQL 5.7 - What's new and How to upgrade
PDF
How to win skeptics to aggregated logging using Vagrant and ELK
PDF
Fluent-bit
PDF
Prometheus @ Proteus Operations
PDF
fluent-plugin-beats at Elasticsearch meetup #14
PDF
elk_stack_alexander_szalonnas
PPTX
ELK Stack
PDF
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
PPTX
Elk ruminating on logs
PPTX
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Attack monitoring using ElasticSearch Logstash and Kibana
MySQL Monitoring using Prometheus & Grafana
Understanding MySQL Performance through Benchmarking
"How about no grep and zabbix?". ELK based alerts and metrics.
Real-time data analysis using ELK
ELK Ruminating on Logs (Zendcon 2016)
Using ELK-Stack (Elasticsearch, Logstash and Kibana) with BizTalk Server
Elk stack
ELK at LinkedIn - Kafka, scaling, lessons learned
Webinar - Centralising syslogs with the new beats, logstash and elasticsearch
MySQL 5.7 - What's new and How to upgrade
How to win skeptics to aggregated logging using Vagrant and ELK
Fluent-bit
Prometheus @ Proteus Operations
fluent-plugin-beats at Elasticsearch meetup #14
elk_stack_alexander_szalonnas
ELK Stack
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Elk ruminating on logs
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Ad

Similar to MySQL Audit using Percona audit plugin and ELK (20)

PDF
Log analysis with the elk stack
PDF
2015 03-16-elk at-bsides
PDF
Null Bachaav - May 07 Attack Monitoring workshop.
PDF
Logs aggregation and analysis
PDF
MySQL Audit using Percona audit plugin and ELK
PPTX
Introduction to Monitoring Tools for DevOps
PPTX
Introduction to Monitoring Tools for DevOps
PPT
Logstash
PDF
PPTX
PDF
ELK: a log management framework
PPTX
Deploying E.L.K stack w Puppet
PPTX
Managing Your Security Logs with Elasticsearch
PDF
Log analysis with elastic stack
PDF
ELK stack introduction
PPT
How ElasticSearch lives in my DevOps life
PDF
Elks for analysing performance test results - Helsinki QA meetup
PDF
The elastic stack on docker
PDF
Javantura v3 - ELK – Big Data for DevOps – Maarten Mulders
PPTX
Mulesoft with ELK (Elastic Search, Log stash, Kibana)
Log analysis with the elk stack
2015 03-16-elk at-bsides
Null Bachaav - May 07 Attack Monitoring workshop.
Logs aggregation and analysis
MySQL Audit using Percona audit plugin and ELK
Introduction to Monitoring Tools for DevOps
Introduction to Monitoring Tools for DevOps
Logstash
ELK: a log management framework
Deploying E.L.K stack w Puppet
Managing Your Security Logs with Elasticsearch
Log analysis with elastic stack
ELK stack introduction
How ElasticSearch lives in my DevOps life
Elks for analysing performance test results - Helsinki QA meetup
The elastic stack on docker
Javantura v3 - ELK – Big Data for DevOps – Maarten Mulders
Mulesoft with ELK (Elastic Search, Log stash, Kibana)

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
ai tools demonstartion for schools and inter college
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
System and Network Administration Chapter 2
PDF
top salesforce developer skills in 2025.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Understanding Forklifts - TECH EHS Solution
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPT
Introduction Database Management System for Course Database
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Odoo Companies in India – Driving Business Transformation.pdf
ai tools demonstartion for schools and inter college
Online Work Permit System for Fast Permit Processing
Navsoft: AI-Powered Business Solutions & Custom Software Development
PTS Company Brochure 2025 (1).pdf.......
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Design an Analysis of Algorithms I-SECS-1021-03
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
System and Network Administration Chapter 2
top salesforce developer skills in 2025.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
2025 Textile ERP Trends: SAP, Odoo & Oracle
Understanding Forklifts - TECH EHS Solution
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Introduction Database Management System for Course Database
Design an Analysis of Algorithms II-SECS-1021-03
Wondershare Filmora 15 Crack With Activation Key [2025
ManageIQ - Sprint 268 Review - Slide Deck
Internet Downloader Manager (IDM) Crack 6.42 Build 41

MySQL Audit using Percona audit plugin and ELK

  • 1. MySQL Audit using percona audit plugin & ELK
  • 3. Object 3 We need - log to MySQL connection information - log to MySQL query log - retrieve these logs using various search conditions - download search results
  • 4. Architecture Percona Audit Plugin 4 DB Servers ELK Server logstash elasticsearch
  • 5. Audit Plugin Which audit plugin will we use? 5 Percona Audit Plugin MariaDB Audit Plugin - support various log format(csv, json, xml) - most of parameter can’t modify online - support various filtering condition (user, query type : ddl, dml, dcl) - most of parameters can modify online - stability issue(db crash) https://mariadb.atlassian.net/browse/MDEV-5145 http://mysql.az/audit-mysql-no-just-crash-it/ - easy install & config - can log at extra log file or syslog file We chose Percona Audit Plugin
  • 6. 6 Percona Audit Plugin Install & Config 6 mysql>install plugin audit_log soname ‘audit_log.so’; Ref URL : https://www.percona.com/doc/percona-server/5.5/management/audit_log_plugin.html $/etc/init.d/mysql restart $vi my.cnf # Server Audit audit_log_format = JSON audit_log_policy = ALL audit_log_syslog_facility = LOG_LOCAL1 audit_log_handler = SYSLOG 1. Percona Audit Plugin Install (over MySQL Ver 5.5.39) – on DB servers 2. Parameter configuration 3. MySQL restart
  • 7. rsyslog config 7 1. rsyslog.conf – on DB servers $ vi /etc/rsyslog.conf # mysql logging local1.* @10.xxx.xxx.xxx # ELK server ip 2. rsyslog restart $ /etc/init.d/rsyslog restart 3. confirm log messages on syslog file $cat messages Jan 29 15:08:30 testdbsvr01 percona-audit: {"audit_record":{"name":"Query","record":"3683778651_1970-01- 01T00:00:00","timestamp":"2016-01-29T06:08:30 UTC","command_class":"select","connection_id":"455338789","status":0,"sqltext":"SELECT * FROM test_table WHERE status='Done'","user":"app[app] @ [10.xxx.xxx.xxx]","host":"","os_user":"","ip":"10.xxx.xxx.xxx"}}
  • 8. 8 rsyslog-ng config 1. rsyslog.conf – on ELK servers $ vi /etc/syslog-ng/syslog-ng.conf source s_sys { file ("/proc/kmsg" program_override("kernel: ")); unix-stream ("/dev/log"); internal(); udp(ip(0.0.0.0) port(514)); ## uncomment this line }; destination d_myaudit { file("/var/log/myaudit/myaudit.${HOST}.${YEAR}-${MONTH}-${DAY}.log" create-dirs(yes) dir-perm(0755) perm(0644) ); }; filter f_myaudit { facility(local1); }; log { source(s_sys); filter(f_myaudit); destination(d_myaudit); }; 2. syslog-ng restart $ /etc/init.d/syslog-ng restart
  • 9. Install ELK Elasticsearch 9 1. elasticsearch install – on ELK server $ yum install elasticsearch 2. configuration $ vi /etc/elasticsearch/elasticsearch.yml cluster.name : my_cluster # cluster name node.name : my_node01 # node name network.host : 10.xxx.xxx.xxx # server’s ip You can download from https://www.elastic.co/downloads/elasticsearch. It needs a recent version of java before install elasticsearch.
  • 10. Install ELK Elasticsearch 10 3. start elasticsearch $/etc/init.d/elasticsearch start 4. Head plugin install $cd /usr/share/elasticsearch/bin $./plugin install mobz/elasticsearch-head 5. Check plugin install http://10.xxx.xxx.xxx:9200/_plugin/head/
  • 11. 1111 Install ELK Logstash 11 1. Install Logstash – on ELK server $ rpm –ivh logstash-2.1.1-1.noarch.rpm 2-1. Configure ( input plugin ) $ sudo vi /etc/logstash/conf.d/01-myaudit-input.conf input { file { type => "myaudit" path => ["/var/log/myaudit/*.log"] start_position => "beginning" codec => 'json' } } You can download from https://www.elastic.co/downloads/logstash
  • 12. 12 Install ELK Logstash 2-2. Configure ( filter plugin ) $ sudo vi /etc/logstash/conf.d/10-myaudit.conf filter { grok { match => { "message" => "%{SYSLOGTIMESTAMP:sys_timestamp}%{SPACE}%{HOSTNAME:host_name} %{SPACE} percona-audit: %{GREEDYDATA:json_data}"} } json { source => "json_data" } }
  • 13. 13 Install ELK Logstash 2-3. Configure ( output plugin ) $ sudo vi /etc/logstash/conf.d/30-elasticsearch-output.conf output { elasticsearch { hosts => "10.xxx.xxx.xxx" } } 3. Start logstash $ sudo /etc/init.d/logstash start
  • 14. 14 Install ELK Kibana 14 1. Kibana install – on ELK server $ tar –xvf kibana-4.3.1-linux-x64.tar.gz 2. configuration $ vi ./config/kibana.yml host: “10.xxx.xxx.xxx” # kibana server ip elasticsearch_url: “http://10.xxx.xxx.xxx:9200” # elasticsearch server ip 4. Check You can download from https://www.elastic.co/downloads/kibana http://10.xxx.xxx.xxx:5601 3. Start Kibana $ ./bin/kibana It needs a space between “host:” and IP.
  • 17. Search condition create(1/3) 17 Make Kibana Dashboard 1 2
  • 18. Search condition create(2/3) 18 Make Kibana Dashboard 3 4
  • 19. 19 Search condition create(3/3) Make Kibana Dashboard 5 6
  • 20. 20 1 Make Graph: line chart(1/6) Make Kibana Dashboard
  • 21. 21 2 Make Kibana Dashboard Make Graph: line chart(2/6)
  • 22. 22 3 4 Make Kibana Dashboard Make Graph: line chart(3/6)
  • 23. 23 5 6 Make Kibana Dashboard Make Graph: line chart(4/6)
  • 24. 24 7 8 Make Kibana Dashboard Make Graph: line chart(5/6)
  • 25. 25 9 Make Kibana Dashboard Make Graph: line chart(6/6)
  • 26. 26 Make Kibana Dashboard Make Graph: Pie chart(1/4) 1
  • 27. 27 Make Kibana Dashboard Make Graph: Pie chart(2/4) 2
  • 28. 28 Make Kibana Dashboard Make Graph: Pie chart(3/4) 3 4
  • 29. 29 Make Kibana Dashboard Make Graph: Pie chart(4/4) 5
  • 31. 31 Make Kibana Dashboard Markdown widget(2/3) 1 ###Menu: // label, the number of “#” determines a size of character. [Main]: //label (/#dashboard/Main): // link dashboard. “Main” is name of dashboard. You have to make dashboard before markdown widget. 2
  • 38. Elasticsearch Plugin – Head(1/2) 38 http://10.xxx.xxx.xxx:9200/_plugin/head/ 1 2 3 4 search query
  • 39. Elasticsearch Plugin – Head(2/2) 39 { "_source": [ "@timestamp", "host_name", "audit_record.user", "audit_record.sqltext", "audit_record.name" ], "sort": { "@timestamp": "asc" }, "size": 100, "query": { "bool": { "must": [ { "range": { "@timestamp": { "gte": "2016-01-16T00:00:00.000", "lte": "2016-01-16T02:59:59.999" } } }, {"term": { "host_name": “host_name123" } }, {"term": { "audit_record.name": "query"} } ] } }} Search condition of string type uses a lower character only. ex) “audit_record.name”:”Query” (x) “audit_record.name”:”query” (o)