Can I define my own log format?
Short answer
Yes. In the Logs profile, Line Format is set to Manual JSON Format, Manual CEF Format or Manual Log Line Format, and the line that will go to the log server is customized. In Manual JSON Format and Manual CEF Format, Key and Value rows are added to the Manual Log Entries table and the values are filled with Smart Variables; in Manual Log Line Format, the whole line is written with the Smart Content Builder. This customization affects only the line that goes to the log server; HTTP logs and TCP logs in Logs & Tracking are kept with fixed fields. To add extra fields to Debug records, Custom Debug Log Entries in the HTTP vService is used.
Problem: The Log Server Expects Different Field Names and Structure
The organization's SIEM or log analysis system expects specific field names and a specific line structure; the ready-made formats do not fit this structure or carry unnecessary fields.
Solution: Four Methods
The first three methods customize the line that goes to the log server, and the fourth customizes the Debug record on the device; they can be used together.
| Your situation | Suitable method |
|---|---|
| My own fields in a JSON or CEF structure | Method 1: Manual JSON Format · Manual CEF Format |
| A completely free-form line | Method 2: Manual Log Line Format |
| Setting up the Manual JSON profile from the command line | Method 3: WEB-CLI |
| An extra field in the Debug record on the device | Method 4: Custom Debug Log Entries |
Method 1: Manual JSON / Manual CEF Format Recommended
- How it works Each Key is a field name and each Value is a Smart Variable; TR7 produces the line as JSON or CEF.
- Where it is openedLoad Balancer → Profiles → Logs → Add
- Requirement A log server that TR7 can reach
- vService type HTTP · L7 TCP
- Variable that does not match the protocol In an L7 TCP vService, a variable that is valid only in HTTP is written with an empty value in JSON, is removed from the line in CEF, and is reported with a notification.
Step-by-Step Configuration
On the Load Balancer → Profiles → Logs screen, the Add button is clicked (profile add form).
Name is entered. In the Log Addresses row, Protocol (default UDP), the IP address of the log server (e.g. 192.0.2.50) and Port are entered (the port field comes empty and is required; the common port for syslog is 514); at least one address is required. Log Standard can be left at the default local.
Line Format = Manual JSON Format or Manual CEF Format is selected; the Manual Log Entries table is added to the form. In each row, Key is the field name, cannot be left empty and must be unique in the table; Value is filled by selecting a Smart Variable from the list (e.g. %SRCIP, %STATUS, %TIMESERVERRES). A new row automatically selects the first unused variable. In JSON, all values are written as text; in CEF, the header is created automatically and a field left empty is removed from the line (Manual Formats).
The Add button is clicked.
On the Load Balancer → Load Balancer vService List screen, the vService is right-clicked and Edit is selected.
In the Details panel on the right of the form, LOG is checked and the created profile is selected in the Log profile field (how to add to a vService). When LOG is checked, the first saved Logs profile comes selected; if there is no profile at all, Stream Log, which does not send to a log server, comes selected.
The Save button is clicked. The progress of applying the change is followed from the sync indicator at the bottom right of the screen. In a cluster setup, with the default auto-sync, the change is also sent to the peer device; if Manual Sync Mode is on, it is sent manually with Synchronize.
Verification
A request is sent to the vService and the incoming line on the log server is checked.
{"client":"…","status":"200"}In the Logs profile list, the profile is clicked and the format and fields in the preview are checked (profile preview).
Manual JSON format and Key/Value rowsMethod 2: Manual Log Line Format
- How it works The whole line is written with Smart Variables and fixed text using the Smart Content Builder.
- Where it is openedLoad Balancer → Profiles → Logs → Line Format = Manual Log Line Format
- Requirement A log server that TR7 can reach
- vService type HTTP · L7 TCP (in L7 TCP, only protocol-independent variables)
Step-by-Step Configuration
On the Load Balancer → Profiles → Logs screen, the Add button is clicked.
Name and Log Addresses are entered as in step 2 of Method 1.
Line Format = Manual Log Line Format is selected and the line is written in the Manual Log Line Format field that opens; with this option, the field is required. Example: %TIME %SRCIP %HTTPMETHOD %PATH %STATUS %DOWNLOADEDBYTE. No protocol check is done in this type: in an L7 TCP vService, if an HTTP-specific variable such as the status code or the request method is used, the line cannot be resolved and the vService cannot be started.
The Add button is clicked.
On the Load Balancer → Load Balancer vService List screen, the vService is right-clicked and Edit is selected.
In the Details panel, LOG is checked and the profile is selected in the Log profile field.
The Save button is clicked; in a cluster, the change passes to the peer device as in Method 1.
Verification
A request is sent to the vService and the incoming line on the log server is checked.
09/Sep/2026:20:37:06 +0300 203.0.113.42 GET /login.php 200 1011Method 3: WEB-CLI
- How it works A Logs profile in Manual JSON format is created from the command line and assigned to the vService.
- Where it is opened TR7 WEB-CLI →
lb log·lb service(format fields) - Requirement WEB-CLI access
- vService type HTTP · L7 TCP
Step-by-Step Configuration
Each --manualLogEntries.N pair is a Key/Value row; the indexes are given in order, starting from 0. If no port is written, 514 is used; there is no Protocol field on the command line, and sending is done over UDP.
lb log add name siem-json --lineFormat manualJSON --logAddresses.0.ip.ip 192.0.2.50 --manualLogEntries.0.key client --manualLogEntries.0.value %SRCIP --manualLogEntries.1.key status --manualLogEntries.1.value %STATUSlb service update id <vService> --log siem-jsonA vService has a single Logs profile; the command replaces the existing profile.
Verification
Command: lb log show siem-json
lineFormat manualJSON · two manualLogEntries rowsA request is sent to the vService and the incoming line on the log server is checked.
{"client":"…","status":"200"}Method 4: Custom Debug Log Entries
- How it works Extra fields are written to Debug records with Smart Variables; in the record preview, they appear in the Custom Entries table.
- Where it is opened vService edit form → Details → Debug → Custom Debug Log Entries
- Requirement HTTP vService; Debug mode on
- vService type HTTP
Step-by-Step Configuration
On the Load Balancer → Load Balancer vService List screen, the HTTP vService is right-clicked and Edit is selected.
In the Details panel, Debug is checked. Effects of Debug mode: What does Debug Mode record; how long should I keep it on?
The Custom Debug Log Entries switch in the Debug section is turned on (off by default) and a row is added with Add.
Entry Name is required; Entry Value is filled by selecting a Smart Variable from the list.
The Save button is clicked.
Verification
In the Logs & Tracking tab of the vService screen, the Debug Mode Logs source is selected and a record is clicked.
Custom Entries table in the Summary tabCommon Mistakes
- Assuming that the manual format will change the HTTP logs in Logs & Tracking. The format determines only the line that goes to the log server.
- Expecting numeric fields to come as numbers in JSON. In Manual JSON Format, all values are written as text; type conversion is defined on the log server.
- Using an HTTP variable with Manual log line format in an L7 TCP vService. There is no protocol check in this type; the vService cannot be started.
- Expecting lines with the built-in Stream log profile. Stream log does not send to a log server; a profile that has a log server address must be assigned to the vService.
- Changing the profile without checking the vServices bound to it. The change is applied immediately to all the vServices that use the profile (Used in).
How it is done in the documentation
