Wisdom Podcast Java Pen questions

Source: Internet
Author: User

Use Java code to complete the following topic, in a log file 2013-05-30.log has the following data:

27.19.74.143--[30/may/2013:17:38:25
27.19.74.143--[30/may/2013:17:38:22
27.19.74.143--[30/may/2013:17:38:23
27.19.74.143--[30/may/2013:17:38:21
27.19.74.143--[30/may/2013:17:38:28
27.19.74.143--[30/may/2013:16:38:20
27.19.74.143--[30/may/2013:18:38:20
27.19.74.143--[30/may/2013:16:39:20
27.19.74.143--[30/may/2013:16:41:20
27.19.74.143--[30/may/2013:17:42:20
27.19.74.143--[30/may/2013:19:38:21
27.19.74.143--[31/may/2013:12:38:21
27.19.74.143--[31/may/2013:16:38:21
27.19.74.143--[31/may/2013:16:38:22
27.19.74.143--[30/may/2013:14:38:21
27.19.74.143--[30/may/2013:14:38:21

The data in the file is a piece of data that is intercepted from the Web server log, and each row contains two information:
1, the website visitor's IP
2, the time of the site visitor request


Definition: Successive requests belong to one "independent access", such as "30/may/2013:17:38:22" and "30/may/2013:17:38:25" two requests belonging to the same independent access
Two requests adjacent to time if the interval exceeds 30 minutes is considered to be two different separate accesses
Requirements: Statistics All "independent access" in the data, output the start request time of each access, end request time, and length of stay (ms)
Examples of output results:
31/may/2013:16:38:21 30/may/2013:16:41:20 181000

Wisdom Podcast Java Pen questions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.