Skip to content

Instantly share code, notes, and snippets.

@simi
Created June 9, 2022 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simi/c713b91fbe8f9dcdcefed7a65908b3c6 to your computer and use it in GitHub Desktop.
Save simi/c713b91fbe8f9dcdcefed7a65908b3c6 to your computer and use it in GitHub Desktop.

Arma Reforger Grok setup

Originally posted by Uro at https://discord.com/channels/105462288051380224/976119935875026964/984473643033690122.


I went into this having not set up Grafana/influxDB or telegraf before, only using Grafana from an end-user perspective, but I do have years of experience in running servers both using Windows and Linux, these applications are natively Linux but do have Windows installers available, so anyone familiar with configuring things in Linux will be aware of how complicated things can be, especially if you have not read the docs.

If your looking to do similar, it does take some setup and configuring so I'd assume you are comfortable setting these sorts of things up and that you have read the docs for telegraf, influxDB and Grafana and how they can work together, they are really well documented so it is worth following their Installation and Getting Started sections as a bare minimum, otherwise you will :blobkeyboardheadsmash: .

For once you get the above setup and running (this will read like gibberish until you have read the docs and have a working installation):

  1. You need to have a telegraf outputs setup/configured to push/output data into influxDB using influxdb_v2 output type to record data from telegraf into influxDB to use later in Grafana - do this and make sure you are seeing data from telegraf in your influxDB bucket before going any further, if you are not pushing data into influxDB with telegraf at this point, 2. and 3. will be completely pointless as your data will be going nowhere.

  2. You should also ensure you can access your influxDB bucket data in Grafana before going further, read the docs if stuck.

  3. The console.log part: In telegraf as an input you need to use an input setup/configured use the input type tail with the data_format set to grok and have it pointing to the correct log file (use absolute paths).

Below are my custom grok regex patterns compatible with telegraf for groking the correct data from the Arma Reforger Server's console.log file:

grok_patterns = ['%{CUSTOM_LOG}']

## Full path(s) to custom pattern files.
grok_custom_pattern_files = []

## Custom patterns can also be defined here. Put one pattern per line.
grok_custom_patterns = '''
CUSTOM_LOG  \sDEFAULT\s*\:\sFPS\:\s%{NUMBER:fps:float},\sframe\stime\s\(avg\:\s%{NUMBER:ft_avg:float}\sms,\smin\:\s%{NUMBER:ft_min:float}\sms,\smax\:\s%{NUMBER:ft_max:float}\sms\),\sMem\:\s%{NUMBER:memory_kB:int}\skB,\sPlayer\:\s%{NUMBER:no_of_players:int},\sAI\:\s%{NUMBER:no_of_ai:int},\sVeh\:\s%{NUMBER:no_of_vehicles_active:int}\s\(%{NUMBER:no_of_vehicles_spawned:int}\),\sProj\s\(S\:\s%{NUMBER:proj_s:float},\sM\:\s%{NUMBER:proj_m:float},\sG\:\s%{NUMBER:proj_g_1:float}\s\|\s%{NUMBER:proj_g_2:float}\).*

I dont have time to hand-hold anyone through setting this up so doing this you are on your own, I provided the telegraf compatible grok regex patterns above which was the most fiddly part to sort out, the rest is on you should you take this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment