i'm asking if it's possible to separate .log line to variable as it was done to construct a .log file. Let me explain :
As it shows on : https://httpd.apache.org/docs/2.4/logs.html
Combined Log format :
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
I have to make this with Java:
Sample line:
xxx.xxx.xxx.xxx - - [03/Jul/2017:09:05:56 +0000] "GET /index.php?route=journal2/assets/css&j2v=2.7.6 HTTP/1.1" xxx xxx "http://xxxxxxxx.xxx.xxx/index.php?route=product/search&search=asus" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.90 Safari/537.36 Vivaldi/1.91.867.38"
I need to separate this string to :
- xxx.xxx.xxx.xxx
- short stroke
- short stroke
- [03/Jul/2017:09:05:56 +0000]
- "GET /index,php?route=journal2/assets/css&j2v=2.7.6 HTTP/1.1"
- xxx
- xxx
- "xxxxxxxx.xxx.xxx/index.php?route=product/search&search=asus" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.90 Safari/537.36 Vivaldi/1.91.867.38"
Got the idea? How can i make it without regex? P.S. it will get like hundreds of lines, so any ideas how to process them like that?