logparser: The input line does not match the specified log format.Line

Hello, sorry to bother you~. I am not very good at English. I wish you can understand what I say o(╯□╰)o .

I use your logparser to parse k8s ingress log. This is my log pattern

PATTERN

"$the_real_ip - [$the_real_ip] - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_length $request_time [$proxy_upstream_name] $upstream_addr $upstream_response_length $upstream_response_time $upstream_status $req_id"

when I use this pattern to parse. I may got this Exception “nl.basjes.parse.core.exceptions.DissectionFailure”. Maybe because some of the log line not Exact match the pattern

Exception Message

Exception in thread "main" nl.basjes.parse.core.exceptions.DissectionFailure: The input line does not match the specified log format.Line     : Value{filled=STRING, s='112.64.166.2 - [112.64.166.2] - - [07/Aug/2020:15:50:07 +0800] "HEAD /ai/search/version HTTP/1.1" 308 0 "-" "curl/7.29.0" 100 0.000 [default-ai-search-prod-svc-5009] - - - - bfb9417db656d95bcfdf3e2a7f47b1ec', l=null, d=null}

I just want request field like HEAD /ai/search/version HTTP/1.1. So, is there a way to avoid this Exception

Finally, thanks supply this lib. Best wishes!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Yes, it is 19:09 here right now.

I think I fixed it. Can you please test? I made a test build that you can find in the maven repository https://oss.sonatype.org/content/repositories/snapshots/ The version is 5.4-SNAPSHOT

I am looking forward for your feedback if this is correct now. If you have more / different examples of problems I would really like to have them.

This is my first issue in github. I feel a little bit amazing , haha!! Thanks your guys for supply so many excellent open source project. It’s really helpful to me.