Comments (4)
- The root cause of the parse error is that in the regex I generate I expect the firstline to look like this:
(?:[a-zA-Z-_]+ .*(?: HTTP/[0-9]+\\.[0-9]+)?)|-
The value \x16\x03\x01 does not match that pattern so the parsing for that line fails.
I just had a look and I think I fixed it (it now allows the firstline to be .*
).
Can you verify please?
- The code you posted looks fine and is how I intended it to be used.
I ran this code by simply parsing the same line 2146891 times and this took approx 48 seconds on my laptop (i7). So yes, slower but not that slow.
Yes, internally I generate a regex for the first parsing layer.
You got to see it as part of the error in the previous question.
The regex is created as 'tightly as possible'. So for example for the IP address the regex is quite elaborate because I want to trip the 'wrong format' situation an still allow both ipv4 and ipv6. This system is slower than 'just a regex' and perhaps there is room to make it faster. Yet this is one of those balances between 'ease of use' vs 'maximum speed'.
from logparser.
One remark on the way you use the code: The parser will ONLY call the setter if it actually has the field.
So if you extract a field that is sometimes present and sometimes it is not you may have 'old values' in your record.
I recommend you include a method to clear the values before you pass it again into the parser.
If for example I add this
@Field("HTTP.METHOD:request.firstline.method")
public void setMethod(String method) {
this.method = method;
}
And then first call it with the 'normal firstline' and the with the "\x16\x03\x01" I would see in both records the method being "GET". In the first record it was extracted, in the second record it was not there so nothing was set and the old value wat not overwritten.
from logparser.
Yes. This issue is gone in version of 3.1-SNAPSHOT from master. When do you plan to release it? For the performance, we may use this library as a additional logic to parse the data if the plan REGEX cannot handle it, so it won't impact the performance too much
from logparser.
I just released version 3.1 that includes these changes.
Should be in maven central in a few hours or so.
from logparser.
Related Issues (20)
- Option to call setter only when value is non-null HOT 3
- Error occurred during setter call: No setter called for key HOT 2
- Fix code coverage reporting HOT 1
- Timestamp format Error should be a Warning HOT 4
- Kubernetes NGINX Ingress Controller default logformat HOT 2
- cannot parse Nginx token : $upstream_response_time HOT 12
- add name change interface HOT 1
- Mapping to Java Data Types? HOT 4
- [QUESTION]: Extra Fields in Results HOT 2
- Update commons-httpclient version HOT 2
- NiFi Processor HOT 1
- The input line does not match the specified log format.Line HOT 18
- HTML encoded special chars in URI HOT 1
- Updating Maxmind GeoIP breaks tests HOT 2
- Support for custom dynamic fields HOT 4
- Action Required: Fix Renovate Configuration
- Dependency Dashboard
- Some format can not parse, ngnix HOT 4
- Exceptions when the status code is 400 and the request url is invalid HOT 4
- Throws exceptions when missing field keys HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logparser.