[Question] Query whole log file using serverquery

How can I query a whole log file using the logview command?
I know, i have to use the command multiple times, but I was not quite able to figure out how to query the whole file without it leaving some stuff out at the beginning of the file

Thank you for your very detailed response. I get that I was on the right track with my implementation as I was already using the begin_pos = last_pos pattern, but the key here seems to be to only get one line at a time after the first query, since I was getting incomplete lines when querieing multiple lines after the first query

Thanks so much. Will implement

MfG

1 Like

I implemented it as you described it. But the first line in the logfile is still missing the first three characters. And the last last_pos is 0 so I should have reached to end but where are my three bytes? I really want them since they are part of the timestamp and I can’t parse it without those three characters

Looks good for me

Log 1 issued with 99 lines

2021-02-05\s07:53:18.366145\pINFO\s\s\s\s\pVirtualServer\s\p1\s\s\pclient\s'Chris'(id:3)\swas\sremoved\sfrom\sservergroup\s'Normal'(id:11)\sby\sclient\s'Chris'(id:3)
2021-02-05\s07:53:25.423506\pINFO\s\s\s\s\pQuery\s\s\s\s\s\s\s\s\s\p1\s\s\pquery\sfrom\s\s1\s[::1]:6026\sissued:\slogview\slines=99



2021-02-05 07:53:18.366145|INFO    |VirtualServer |1  |client 'Chris'(id:3) was removed from servergroup 'Normal'(id:11) by client 'Chris'(id:3)
2021-02-05 07:53:25.423506|INFO    |Query         |1  |query from  1 [::1]:6026 issued: logview lines=99

Log 0 issued with 99 lines

2021-02-05 07:51:05.114951|INFO    |Query         |   |query from 1 [::1]:6026 issued: login with account "serveradmin"(serveradmin)
2021-02-05 07:51:10.377080|INFO    |Query         |   |query from  1 [::1]:6026 issued: use 1



2021-02-05\s07:51:05.114951\pINFO\s\s\s\s\pQuery\s\s\s\s\s\s\s\s\s\p\s\s\s\pquery\sfrom\s1\s[::1]:6026\sissued:\slogin\swith\saccount\s"serveradmin"(serveradmin)
2021-02-05\s07:51:10.377080\pINFO\s\s\s\s\pQuery\s\s\s\s\s\s\s\s\s\p\s\s\s\pquery\sfrom\s\s1\s[::1]:6026\sissued:\suse\s1
2 Likes

I did it on linux so this is not os dependend