0

I'm using Ookla Server, it runs on port 8080 and does speed tests for mobile apps (not the HTTP) side

it logs too much verbose, it's set to application, the only error is the other option

it logs data like this every second, the log is too big too much info


 [14/Jun/2021:17:46:46 GMT] "Disconnect NetException: Connection reset by peer"  "" "" 
[14/Jun/2021:17:46:46 GMT] "Disconnect NetException: Connection reset by peer"  "" "" 
[14/Jun/2021:17:46:46 GMT] "Disconnect NetException: Connection reset by peer"  "" "" 
[14/Jun/2021:17:46:47 GMT] "TCP uptime: 101 - total current: 2, queued: 0, blocked: 0, queueFull: 0, concurrent: 6, currentThreads: 4"  "" "" 

I tried different options to exclude "TCP" lines for example (from my ooklaserver.properties config) with regex data i found on stack overflow

#logging.loggers.app.name = Application
logging.loggers.app.channel.class = FileChannel
#logging.loggers.app.channel.pattern = %Y-%m-%d %H:%M:%S [%P - %I] [%p] %t
#logging.loggers.app.channel.pattern = %[client_plaintext] - %[session] [%d/%b/%Y:%H:%M:%S %Z] "%t" %[status] %[size] "%[referer]" "%[useragent]"
#logging.loggers.app.channel.pattern = %[client_plaintext] - %[session] [%d/%b/%Y:%H:%M:%S %Z] "%[referer]" "%[useragent]"
logging.loggers.app.channel.pattern =  sub(r'(?<!\b[ia])t\b', '', TCP) (r'^(?!/TCP).*$') %[client_plaintext] - [%d/%b/%Y:%H:%M:%S %Z] "%t" %[size] "%[referer]" "%[useragent]" 

logging.loggers.app.channel.path = ${application.dir}/ooklaserver.log

maybe the exclude part has to run in different command and rewrite? basically, I just want to log IP & time...

tried How to exclude specific string using regex in Python? using regular expressions to exclude characters in a string search? How to exclude a character from a regex group? A regular expression to exclude a word/string thank you so much!

Ismael Padilla
  • 4,666
  • 4
  • 23
  • 33

0 Answers0