Skip to content

JiyoungMa/LogProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

LogProject

현장실습 중 진행한 로그 분석 프로젝트 (Log Analysis Project Conducted During Field Training)

  • 현장실습 기간 (Field Training Period) : 2020-12-28 ~ 2021-02-26

프로젝트 환경 설정 (Project Environment Setting)

tools version
Python 3.7.1
openpyxl 2.5.12
user-agents 2.2.0
elasticsearch 7.10.1
google-api-core 1.24.1
google-api-python-client 1.12.8
google-auth 1.24.0
google-auth-httplib2 0.0.4
google-auth-oauthlib 0.4.2
googleapis-common-protos 1.52.0



프로젝트 설명

코드 목록

Extract Data From Elastic

Elastic Search에 저장되어있는 log data를 가져와서 하루 단위로 json 저장을 하는 코드

  • 현재 설정 : client.geo.ip, django.url.full, django.request.headers.User-Agent가 있는 로그들의 timestamp, django.user.username, client.geo.ip, django.url.full, django.request.headers.User-Agent를 저장

  • 설정 변경 방법 : body 변수를 원하는 조건으로 변경

  • Log 저장 시작 날짜 변경 방법

    : 원하는 날짜가 year-month-date,hour-minutes-seconds일 경우

    start = 'year-month-(date-1)T(hour-9):minutes:seconds'

    end = 'year-month-dateT(hour-9):minutes:seconds'

    위와 같이 start,end의 값을 변경한다.

    시차를 고려해야 하기 때문에 hour-9를 해야한다.



User Retention

한 주 동안 가입한 유저들이 얼마나 로그인을 유지하고 웹사이트에 접속하는지 한 주 단위로 추적하는 코드

  • Extract Data From Elastic을 통해 생성한 json 파일과 사전에 제공받은 가입 관련 엑셀파일을 사용
  • 한 주 단위로 로그인 유저들의 retention을 계산

결과



Users Without Login

가입 유저들 중, 로그아웃 상태로 웹사이트에 접근하는 경우가 몇 퍼센트인지 추적하는 코드

  • User Retention과 동일하게 Extract Data From Elastic을 통해 생성한 json 파일과 사전에 제공받은 가입 관련 엑셀 파일을 사용
  • 한 주 단위로 가입 유저들의 비로그인 사용 retention 계산

결과



Get Rid Of Duplication

가입 유저들이 로그인 또는 비로그인 상태로 웹사이트에 접속하는 retention을 계산하는 코드

  • User Retention와 Users Without Login을 통해 측정한 결과의 중복을 없애기 위한 코드

결과



Users Per Id And Ids Per User

하나의 IP당 몇 명의 유저들이 있는지, 하나의 유저들이 몇 개의 IP를 사용하는지를 체크하는 코드

  • 같은 ip를 몇 명의 유저들이 공유하는지, 한 유저가 몇 개의 ip를 가지고 있는지를 측정하기 위해 ip별 유저들, 유저 별 ip를 google sheet에 업로드 하는 코드

결과

Details of Projects

Project List

Extract Data From Elastic

Code for importing log data stored in ElasticSearch and storing json on a daily basis

  • Current settings : Store the logs' timestamp, django.user.username, client.geo.ip, django.url.full, django.request.headers.User-Agent that have client.geo.ip, django.url.full, django.request.headers.User-Agent
  • How to change the setting: Change the body variable to the desired condition

  • How to Change Log Save Start Date

    : If you want year-month-date,hour-minutes-seconds

    start = 'year-month-(date-1)T(hour-9):minutes:seconds'

    end = 'year-month-dateT(hour-9):minutes:seconds'

    Change the values of start and end as above.

    Hour-9 should be done because the time difference should be considered.



User Retention

Code that keeps users logged in during the week and keeps track of how much they access the website on a weekly basis

  • Use the json file generated by 'Extract Data From Elastic' and the pre-provided Excel file.
  • Calculate the retention of logged-in users on a weekly basis.

Result



Users Without Login

Code that tracks the percentage of registered users accessing websites while logged out

  • Use the json file generated by 'Extract Data From Elastic' and the pre-provided Excel file.
  • Calculation of Non-Login Retention for Registered Users on a weekly basis

Result



Get Rid Of Duplication

Code for calculating the retention of registered users to access the website while logged in or non-logged in.

  • Code to eliminate duplication of measurement results through User Retention and Users Without Login

Result



Users Per Id And Ids Per User

Code that checks how many users are per IP and how many IPs a user uses

  • To measure how many users share the same ip and how many ips a user has, the code to upload the ip per ip and the ip per user to the Google sheet.

Result

About

현장실습 시 진행한 Elastic Search를 사용한 로그 분석 프로젝트

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages