Comments (2)
Please specify the logformat and what goes wrong in the mentioned logline. I currently do not see how matching beyond the end of the line can make a difference?
from logparser.
I had a good look at your log line and to me it seems like the 'combined' logformat with two extra numbers directly after the time field (I'm guessing something like %B and %D).
I did a quick test with this logformat:
%h %l %u %t %B %D "%r" %>s %b "%{Referer}i" "%{User-Agent}i"
The result is the system parses this completely fine:
public class Record extends HashMap<String, String> {
@Override
public String put(String key, String value) {
return super.put(key, value);
}
}
@Test
public void testReportedProblem() throws Exception {
String line = "1.1.1.1 - - [31/Jul/2016:03:07:00 -0500] 4679405 4 \"GET /admin/cc_info.php?done=1&mv_action=done&_r=106 HTTP/1.1\" 200 2618 \"https://example.com/admin/cc_info.php?done=1&mv_action=done&_r=106\" \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36\"";
String format = "%h %l %u %t %B %D \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"";
String[] params = {
"STRING:request.firstline.uri.query.done",
"STRING:request.firstline.uri.query.mv_action",
"STRING:request.firstline.uri.query._r",
};
Parser<Record> parser = new ApacheHttpdLoglineParser<>(Record.class, format);
parser.addParseTarget(Record.class.getMethod("put", String.class, String.class), Arrays.asList(params));
Map<String, String> values = parser.parse(new Record(), line);
System.out.println(values);
}
I'm closing this for now because I cannot reproduce it.
from logparser.
Related Issues (20)
- Some format can not parse, ngnix HOT 4
- Exceptions when the status code is 400 and the request url is invalid HOT 4
- Custom timeformat doesn't work HOT 3
- 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
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.