Here, client X.X.X.X request to server Y.Y.Y.Y did trigger the rule 42000227 in the var named user-agent in theHEADERS zone. id X might seem obscure, but you can see the meaning in naxsi_core.rules:
MainRule "str:<" "msg:html open tag" "mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie" "s:$XSS:8" id:1302;
NAXSI_FMT is composed of different items :
ip : Client's ip
server : Requested Hostname (as seen in http header Host)
uri: Requested URI (without arguments, stops at ?)
learning: tells if naxsi was in learning mode (0/1)
total_processed: Total number of requests processed by nginx's worker
total_blocked: Total number of requests blocked by (naxsi) nginx's worker
zoneN: Zone in which match happened (see "Zones" in the table below)
idN: The rule id that matched
var_nameN: Variable name in which match happened (optional)
cscoreN : named score tag
scoreN : associated named score value
Several groups of zone, id, var_name, cscore and score can be present in a single line.
NAXSI_EXLOG
NAXSI_EXLOG is a complement to naxsilogs. Along with exceptions, it contains actual content of the matched request. While NAXSI_FMT only contains IDs and location of exception, NAXSI_EXLOG provides actual content, allowing you to easily decide if it's a false positive or not.
Learning tools uses this at his advantage. Extensive log is enabled by adding the following line in your server {} section but out of your location.
"User defined" rules are supposed to have IDs > 1000.
IDs inferior 1000 are reserved for naxsi internal rules, which are usually related to protocol sanity and things that cannot be expressed through regular expressions or string matches.
Think twice before whitelisting one of those IDs, as it might partially/totally disable naxsi.