Skip to content

Commit 891a8f9

Browse files
Limit log query result size (#26)
Set a max number of records returned by Loki to avoid leaking memory. Refs NethServer/dev#6978
1 parent d4a6ae5 commit 891a8f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

imageroot/bin/cloud-log-manager-forwarder

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ logs_list = []
7676
while True:
7777
try:
7878
# LogCLI command
79-
logcli_command = ["logcli", "query", "--limit", "0", "--forward", "--timezone", "UTC", "--from", last_timestamp, "--no-labels", "-q", "-o", "jsonl",
79+
logcli_command = ["logcli", "query", "--limit", "2000", "--forward", "--timezone", "UTC", "--from", last_timestamp, "--no-labels", "-q", "-o", "jsonl",
8080
'{node_id=~".+"} | json identifier="SYSLOG_IDENTIFIER", priority="PRIORITY", message="MESSAGE" | line_format "<{{.priority}}> [{{.node_id}}:{{.module_id}}:{{.identifier}}]: {{.message}}"']
8181
response = subprocess.run(logcli_command, capture_output=True, text=True, timeout=300)
8282

0 commit comments

Comments
 (0)