Giter VIP home page Giter VIP logo

accesslogparser's Introduction

Aiempi hahmotelma skriptin mahdollisesta toimintalogiikasta. Mahdollistaisi sen, että lokeista luetaan vain uudet osat, ei jo luettua uudestaan. Kuitenkin tarpeettoman monimutkaista?

# alustus
if ei löydy tilaa taulusta:
   luetaan access.log.1 jos on (eka päivä heitetään hukkaan)
   luetaan access.log
else:
    # sivusto.mtime == mtime(access.log.1)
    if rotatoitu:
        seek(access.log.1, seekpoint)
        tiedostolista = [access.log.1, access.log]
    else:
        seek(access.log, seekpoint)
        tiedostolista = [access.log]

    if not md5(rivi) == md5:
        # jos rotatoitu huonosti
        alustus()
    else:
        jatketaan lukemista
Tilataulu (mihin kelataan)  (onko rotatoitu)
 sivusto  | seekpoint   | al1 mtime  | md5(viimeinen rivi)
  yx.fi       123899      1234567890 | abcdabbacd
         = edellisen päivän
           viimeisen rivin alku
Hitit
  sivusto   |   päivä     | tavuja   | hittejä
yx.fi          2009-11-10   100000      2900
yx.fi          2009-11-10   100000      2900
derbian.fi     2009-11-10   100000000   2900000
derbian.fi     2009-11-10   100000000   2900000

accesslogparser's People

Contributors

ahinkka avatar joneskoo 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.