# -*- mode: ruby -*- require 'base64' Populus.config do set :slack_webhook, "https://hooks.slack.com/services/XXXXXX" end Populus.watch :event, name: "sample" do cond {|data| data.any?{|d| !d['Payload'].nil? } } runs do |data| event = data.find{|d| !d['Payload'].nil? } Populus.logger.info "From populus!!!" Populus.logger.info Base64.decode64(event['Payload']) notify_to_slack(<<-EOF, channel: '#bot_test', username: "Populus") Hello!!! Consul event payload: >>> `#{event.inspect}`" EOF end end