Web server log which maintains a history of page requests, typically appended to the end of the file. Information about the request, including client IP address, request date/time, page requested, HTTP code, bytes served, user agent, and referrer are typically added.
Given a web server log records, find the total number of successful HTTL responses (200 code) for IP addresses with successful responses.
Input : Sample Access Log 192.168.1.2 - - [17/Sep/2013:22:18:19 -0700] "GET /abc HTTP/1.1" 404 201 192.168.1.2 - - [17/Sep/2013:22:18:19 -0700] "GET /favicon.ico HTTP/1.1" 200 1406 192.168.1.2 - - [17/Sep/2013:22:18:27 -0700] "GET /wp/ HTTP/1.1" 200 5325 192.168.1.2 - - [17/Sep/2013:22:18:27 -0700] "GET /wp/wp-content/themes/twentytwelve/style.css?ver=3.5.1 HTTP/1.1" 200 35292 192.168.1.3 - - [17/Sep/2013:22:18:27 -0700] "GET /wp/wp-content/themes/twentytwelve/js/navigation.js?ver=1.0 HTTP/1.1" 200 863 Output : 192.168.1.3 1 192.168.1.2 3
Prerequisite : Regular Expression in Java
220.127.116.11 1 18.104.22.168 1 22.214.171.124 3
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Parsing String of symbols to Expression
- Spring Boot | How to publish String messages on Apache Kafka
- Spring Boot | How to publish JSON messages on Apache Kafka
- Output of Java Programs | Set 55 (Java Collections Framework)
- Java 8 | Consumer Interface in Java with Examples
- Java.lang.String.matches() in Java
- Java 8 | IntToLongFunction Interface in Java with Examples
- Java 8 | BiConsumer Interface in Java with Examples
- SHA-384 Hash In Java
- SHA-512 Hash In Java
- Hashing in Java
- SHA-224 Hash In Java
- MD2 Hash In Java
- Quantifiers in Java
- Sorting in Java
- MD5 hash in Java
- Min Heap in Java
- Java AWT | CardLayout Class
- Initializing a List in Java
- Java Swing | JMenuBar
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.