.. _events: Events ====== .. _logged_events: Logged Events ------------- .. TODO: This needs work IScorE logs some of it's internal events to aid in analysis of Competition data. Logs of flag events are kept in the ``event.log`` file. This file is configurable through the standard Django ``LOGGING`` setting. The name of the IScorE event logger is ``iscore.events``. The service scanner logs are handled differently, they can be found in ``servicecheck/scan_logs/`` and use their timestamp as the file name. .. _published_events: Published Events ---------------- .. versionadded:: 1.5 .. note:: This feature requires a Redis server If desired, IScorE can be configured to publish certain events to a redis PubSub channel. This is an optional feature that is disabled by default. It is the official way for external applications to react to events within IScorE. Settings -------- ``PUBLISH_EVENTS`` (default False) If True, IScorE will publish events to Redis. ``REDIS_URL`` (default None) When ``PUBLISH_EVENTS`` is True, IScorE will connect to Redis at this url to publish events. ``EVENT_CHANNEL`` (default ``iscore``) The name of the Redis PubSub channel IScorE will push events to. Events ------ All events are json objects with an ``event`` key containing the type of event. The event may also contain additional data specific to the type of event. IScorE will publish the following events: ``FLAG_CAPTURE`` Sent when Red Team Captures a flag. Contains the name of the flag and the team number. ``FLAG_PLANT`` Sent when Red Team Plants a flag. Contains the name of the flag and the team number. Functions --------- The following functions can be used to send events from IScorE (useful for :ref:`External Service Checks `) .. autofunction:: base.actions.publish_event