Giter Club home page Giter Club logo

bunnylog-py's Introduction

NAME

bunnylog - Python module to parse BunnyCDN log files

SYNOPSIS

  import bunnylog

  bw = 0

  with open('server.log') as logfile:
    for line in logfile:
      log = bunnylog.parse_line(line)

      bw += log.length

  print(f"Used {bw} bytes of bandwidth")

DESCRIPTION

This module aims to parse the log files generated by BunnyCDN. You can then take these and input them to your database or convert them to other log formats.

MODEL

LogEntry

This module parses the log entries into LogEntry objects. Each object has the following values.

  • hit - bool
    This value indicates if a request was a cache hit

  • status_code - int
    The status code returned by the server

  • timestamp - int
    The timestamp of the request

  • length - int
    The length of the response in bytes

  • pull_server - str
    The ID of the pull server on BunnyCDN

  • ip - str
    The IP address of the visitor

  • referrer - str
    The referrer page, indicated by the referer header

  • url - str
    The URL for the request

  • cdn_country - str
    The country code for the CDN node that served this request

  • user_agent - str
    The User-Agent header of the request

  • content_hash - str
    The hash of the content that was sent to the client

  • visitor_country - str
    The country code of the visitor

INTERFACE

parse_line

Takes a log line as a string and returns a parsed LogEntry.

bunnylog-py's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.