telegraf/plugins/inputs/minecraft
Maximilien Richer 5f215c22fe Fix typos in comments (#3415) 2017-10-31 17:00:06 -07:00
..
internal/rcon Fix typos in comments (#3415) 2017-10-31 17:00:06 -07:00
README.md Add Minecraft input plugin (#2960) 2017-06-23 16:54:12 -07:00
minecraft.go Fix typos in comments (#3415) 2017-10-31 17:00:06 -07:00
minecraft_test.go Fix several bugs in minecraft input (#2970) 2017-06-27 13:14:07 -07:00
rcon.go Fix typos in comments (#3415) 2017-10-31 17:00:06 -07:00
rcon_disconnect_error_test.go Fix several bugs in minecraft input (#2970) 2017-06-27 13:14:07 -07:00
rcon_test.go Fix several bugs in minecraft input (#2970) 2017-06-27 13:14:07 -07:00

README.md

Minecraft Plugin

This plugin uses the RCON protocol to collect statistics from a scoreboard on a Minecraft server.

To enable RCON on the minecraft server, add this to your server configuration in the server.properties file:

enable-rcon=true
rcon.password=<your password>
rcon.port=<1-65535>

To create a new scoreboard objective called jump on a minecraft server tracking the stat.jump criteria, run this command in the Minecraft console:

/scoreboard objectives add jump stat.jump

Stats are collected with the following RCON command, issued by the plugin:

/scoreboard players list *

Configuration:

[[inputs.minecraft]]
   # server address for minecraft
   server = "localhost"
   # port for RCON
   port = "25575"
   # password RCON for mincraft server
   password = "replace_me"

Measurements & Fields:

This plugin uses only one measurement, titled minecraft

  • The field name is the scoreboard objective name.

  • The field value is the count of the scoreboard objective

  • minecraft

    • <objective_name> (integer, count)

Tags:

  • The minecraft measurement:
    • server: the Minecraft RCON server
    • player: the Minecraft player

Sample Queries:

Get the number of jumps per player in the last hour:

SELECT SPREAD("jump") FROM "minecraft" WHERE time > now() - 1h GROUP BY "player"

Example Output:

$ telegraf --input-filter minecraft --test
* Plugin: inputs.minecraft, Collection 1
> minecraft,player=notch,server=127.0.0.1:25575 jumps=178i 1498261397000000000
> minecraft,player=dinnerbone,server=127.0.0.1:25575 deaths=1i,jumps=1999i,cow_kills=1i 1498261397000000000
> minecraft,player=jeb,server=127.0.0.1:25575 d_pickaxe=1i,damage_dealt=80i,d_sword=2i,hunger=20i,health=20i,kills=1i,level=33i,jumps=264i,armor=15i 1498261397000000000