mirror of
https://github.com/themasch/nginx-log-parser.git
synced 2025-02-13 12:10:28 +00:00
added a basic readme.
added IDE files to gitignore.
This commit is contained in:
parent
e22d94dd4c
commit
9afbf7d06c
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
/target
|
/target
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
sample/
|
sample/
|
||||||
|
nginx-log-parser.iml
|
||||||
|
.idea/
|
17
README.md
Normal file
17
README.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# nginx_log_parser
|
||||||
|
|
||||||
|
A rust library to read nginx log files.
|
||||||
|
|
||||||
|
Takes a nginx-like syntax for the format and generates a parser that reads log lines.
|
||||||
|
```rust
|
||||||
|
extern crate nginx_log_parser;
|
||||||
|
use nginx_log_parser::Format;
|
||||||
|
|
||||||
|
let format = Format::from_str("$remote_addr [$time_local] $request").unwrap();
|
||||||
|
let entry = format.parse("1.2.3.4 [11/Sep/2018:08:44:17 +0000] GET / HTTP/1.1");
|
||||||
|
assert_eq!(Some("GET / HTTP/1.1"), entry.unwrap().get("request"));
|
||||||
|
```
|
||||||
|
|
||||||
|
## To be done
|
||||||
|
- more tests
|
||||||
|
- make the parser fast (do not use a full-featured-regex engine)
|
Loading…
x
Reference in New Issue
Block a user