Skip to content

Commit 67cf063

Browse files
defanatorFelipe Zimmerle
authored and
Felipe Zimmerle
committed
modsecurity_transaction_id: docs
1 parent 27059c1 commit 67cf063

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,51 @@ server {
122122
}
123123
```
124124

125+
modsecurity_transaction_id
126+
--------------------------
127+
**syntax:** *modsecurity_transaction_id string*
128+
129+
**context:** *http, server, location*
130+
131+
**default:** *no*
132+
133+
Allows to pass transaction ID from nginx instead of generating it in the library.
134+
This can be useful for tracing purposes, e.g. consider this configuration:
135+
136+
```nginx
137+
log_format extended '$remote_addr - $remote_user [$time_local] '
138+
'"$request" $status $body_bytes_sent '
139+
'"$http_referer" "$http_user_agent" $request_id';
140+
141+
server {
142+
server_name host1;
143+
modsecurity on;
144+
modsecurity_transaction_id "host1-$request_id";
145+
access_log logs/host1-access.log extended;
146+
error_log logs/host1-error.log;
147+
location / {
148+
...
149+
}
150+
}
151+
152+
server {
153+
server_name host2;
154+
modsecurity on;
155+
modsecurity_transaction_id "host2-$request_id";
156+
access_log logs/host2-access.log extended;
157+
error_log logs/host2-error.log;
158+
location / {
159+
...
160+
}
161+
}
162+
```
163+
164+
Using a combination of log_format and modsecurity_transaction_id you will
165+
be able to find correlations between access log and error log entries
166+
using the same unique identificator.
167+
168+
String can contain variables.
169+
125170

126171
# Contributing
127172

0 commit comments

Comments
 (0)