Working with Filter Node Logs¶
This article guides you on how to find the log files of a Wallarm filtering node.
The location of log files varies based on the installation method of the node:
For installations via the all-in-one installer, log files are situated within
Here is a breakdown of the log files you will encounter and the type of information each contains:
brute-detect.log: the log of fetching the brute force attack-related counters in the filter node cluster.
export-attacks.log: the log of exporting the attacks' data from the postanalytics module to the Wallarm cloud.
export-counters.log: the log of exporting the counters' data (see “Monitoring the Filter Node”).
export-environment.log: the log of collecting the installed Wallarm package versions and uploading this data to the Wallarm Cloud to be displayed in the filtering node details in Wallarm Console. These processes are run once per hour.
syncnode.log: the log of syncing the filter node with the Wallarm cloud (this includes fetching the LOM and proton.db files from the cloud).
tarantool.log: the log of the postanalytics module operations.
sync-blacklist.login the previous node versions): the log of syncing the filtering node with IP addresses added to IP lists as single objects or subnets.
sync-mmdb.login the previous node versions): the log of syncing the filtering node with IP addresses registered in countries, regions and data centers from IP lists.
appstructure.log(only in the Docker containers): the log of the API Discovery module activity.
registernode_loop.log(only in the Docker containers): the log of activity of the wrapper script running the
register-nodescript while it is succeeded.
weak-jwt-detect.log: the log of the JWT vulnerability detection.
Configuring Extended Logging for the NGINX‑Based Filter Node¶
NGINX writes logs of the processed requests (access logs) into a separate log file, using the predefined
combined logging format by default.
You can define and use a custom logging format by including one or several filter node variables (as well as other NGINX variables if needed). The NGINX log file will allow for much faster filter node diagnostics.
Filter Node Variables¶
You may use the following filter node variables when defining the NGINX logging format:
| ||String||Request identifier |
Has the following value form:
| ||Float||Time in seconds the CPU of the machine with the filtering node spent processing the request.|
| ||Float||Time in seconds the CPU spent processing the request + time in the queue. For example, if the request was in the queue for 3 seconds and processed by CPU for 1 second, then: |
| ||Integer||Size of the serialized request in bytes|
| ||Integer||Request validity |
| ||String||Attack types detected in the request with the library libproton. Types are presented in text format: |
| ||Integer||Attack types detected in the request with the library libproton. Types are presented in bit string format: |
Let us assume that you need to specify the extended logging format named
wallarm_combined that includes the following variables:
all variables used in the
all filter node variables
To do this, perform the following actions:
The lines below describe the desired logging format. Add them into the
httpblock of the NGINX configuration file.
log_format wallarm_combined '$remote_addr - $remote_user [$time_local] ' '"$request" $request_id $status $body_bytes_sent ' '"$http_referer" "$http_user_agent" ' '$wallarm_request_cpu_time $wallarm_request_mono_time $wallarm_serialized_size $wallarm_is_input_valid $wallarm_attack_type $wallarm_attack_type_list';
Enable the extended logging format by adding the following directive into the same block as in the first step:
access_log /var/log/nginx/access.log wallarm_combined;
Processed request logs will be written in the
wallarm_combinedformat into the
With the directive listed above, all processed requests will be logged to a log file, including these that are not related to an attack.
You can configure conditional logging to write logs only for the requests that are part of an attack (the
wallarm_attack_typevariable value is not zero for these requests). To do so, add a condition to the aforementioned directive:
access_log /var/log/nginx/access.log wallarm_combined if=$wallarm_attack_type;
This may be useful if you want to reduce a log file size, or if you integrate a filter node with one of SIEM solutions.
Restart NGINX by running one of the following commands depending on the OS you are using:
To see detailed information about configuring logging in NGINX, proceed to this link.