Skip to content

Instantly share code, notes, and snippets.

@pysysops
Created August 9, 2016 12:08
Show Gist options
  • Save pysysops/a9d954de031b97fd4e55da34b54c8892 to your computer and use it in GitHub Desktop.
Save pysysops/a9d954de031b97fd4e55da34b54c8892 to your computer and use it in GitHub Desktop.
pseudo-random loadbalancing:
scope['cdl_logstash::gelf_servers'][ @ipaddress.gsub(/[\D]+/i,'').to_i % scope['cdl_logstash::gelf_servers'].length.to_i ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment