Git Product home page Git Product logo

factorio-logparser's Introduction

Factorio Log Parser

A crude log parser for Factorio. Run this within a screen, or use the provided systemd example unit to monitor and parse your factorio log.

The script will output a status.json file containing the connected peers throughout the server sessions lifetime. (the list of peers will be reset every time the server/script is restarted).

While the script itself only provides the information it is up to you to use it in a creative way - for example by presenting the currently online peers on your server status page, or listing the most frequently re-connecting player this session?

Output (JSON)

The output file presents you with continous parsing result of the servers "current" state. Using this information we can see that since the server started, peer 3 desynced 6 times in short sequence - perhaps a temporary ban is in order? With both peer ip and port at hand you could easily parse this file and adjust your firewall rules to prevent peer 3 from reconnecting for a while.

Example:

{
"generated": "2015-08-13T11:07:24.635245+00:00",
"peers": {
 "1": {
  "connected": "2015-08-13T11:07:20.475868+00:00",
  "desyncs": [],
  "disconnected": "2015-08-13T11:07:20.481195+00:00",
  "online": false,
  "peer_ip": "X.X.X.X",
  "peer_port": 34198,
  "player_index": "0",
  "username": "RandomPlayer"
 },
 "2": {
  "connected": "2015-08-13T11:07:20.476307+00:00",
  "desyncs": [
   "2015-08-13T11:07:20.476866+00:00",
   "2015-08-13T11:07:20.477324+00:00"
  ],
  "disconnected": "2015-08-13T11:07:20.478208+00:00",
  "online": false,
  "peer_ip": "X.X.X.X",
  "peer_port": 51518,
  "player_index": "4",
  "username": "RandomGuy"
 },
 "3": {
  "connected": "2015-08-13T11:07:20.478347+00:00",
  "desyncs": [
   "2015-08-13T11:07:20.478886+00:00",
   "2015-08-13T11:07:20.479342+00:00",
   "2015-08-13T11:07:20.479851+00:00",
   "2015-08-13T11:07:20.480313+00:00",
   "2015-08-13T11:07:20.480766+00:00",
   "2015-08-13T11:07:20.481278+00:00"
  ],
  "disconnected": "2015-08-13T11:07:20.482085+00:00",
  "online": false,
  "peer_ip": "X.X.X.X",
  "peer_port": 34197,
  "player_index": "8",
  "username": "SomeOne"
 }
}
}

Versioning

The code adheres to Semantic Versioning v2.0.0 http://semver.org/spec/v2.0.0.html A release is denoted by the github release system using git tags.

License

This code is realeased with the MIT license, see the LICENSE file.

factorio-logparser's People

Contributors

bisa avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

izanbard

factorio-logparser's Issues

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.