{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/consul-template/issues/357","labels_url":"https://api.github.com/repos/hashicorp/consul-template/issues/357/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/consul-template/issues/357/comments","events_url":"https://api.github.com/repos/hashicorp/consul-template/issues/357/events","html_url":"https://github.com/hashicorp/consul-template/issues/357","id":100203967,"number":357,"title":"range service with regexMatch","user":{"login":"ljcp","id":1672971,"avatar_url":"https://avatars.githubusercontent.com/u/1672971?v=3","gravatar_id":"","url":"https://api.github.com/users/ljcp","html_url":"https://github.com/ljcp","followers_url":"https://api.github.com/users/ljcp/followers","following_url":"https://api.github.com/users/ljcp/following{/other_user}","gists_url":"https://api.github.com/users/ljcp/gists{/gist_id}","starred_url":"https://api.github.com/users/ljcp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljcp/subscriptions","organizations_url":"https://api.github.com/users/ljcp/orgs","repos_url":"https://api.github.com/users/ljcp/repos","events_url":"https://api.github.com/users/ljcp/events{/privacy}","received_events_url":"https://api.github.com/users/ljcp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-08-11T01:34:47Z","updated_at":"2015-08-12T03:02:31Z","closed_at":"2015-08-11T05:11:36Z","body":"I want to list all the services that starts with webserver\r\n\r\nwebserver-one\r\nwebserver-two\r\n....\r\n\r\n```\r\n{{range service | regexMatch \"webserver*\"}}\r\n      server {{.Name}}:{{.Port}};\r\n                {{else}}\r\n                        server 127.0.0.1;\r\n                {{end}}\r\n\r\n```\r\n\r\nbut i throws an error ? any clues "},"comment":{"url":"https://api.github.com/repos/hashicorp/consul-template/issues/comments/130142347","html_url":"https://github.com/hashicorp/consul-template/issues/357#issuecomment-130142347","issue_url":"https://api.github.com/repos/hashicorp/consul-template/issues/357","id":130142347,"user":{"login":"sethvargo","id":408570,"avatar_url":"https://avatars.githubusercontent.com/u/408570?v=3","gravatar_id":"","url":"https://api.github.com/users/sethvargo","html_url":"https://github.com/sethvargo","followers_url":"https://api.github.com/users/sethvargo/followers","following_url":"https://api.github.com/users/sethvargo/following{/other_user}","gists_url":"https://api.github.com/users/sethvargo/gists{/gist_id}","starred_url":"https://api.github.com/users/sethvargo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethvargo/subscriptions","organizations_url":"https://api.github.com/users/sethvargo/orgs","repos_url":"https://api.github.com/users/sethvargo/repos","events_url":"https://api.github.com/users/sethvargo/events{/privacy}","received_events_url":"https://api.github.com/users/sethvargo/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T03:02:31Z","updated_at":"2015-08-12T03:02:31Z","body":"Hi @ljcp \r\n\r\nThe first issue with whitespace is not a Consul Template issue, but rather a Go templating issue. You're looping over something that includes whitespace. I usually play around with it, but you'll want to reduce whitespace like this:\r\n\r\n```liquid\r\nupstream xxxxxxx {\r\n{{with node \"xx\" }}{{range .Services}}\r\n  server {{.Service}}.service.xx.xx.xx:{{.Port}};\r\n{{end}}{{end}}\r\n}\r\n```\r\n\r\nThe second issue simply isn't possible. `user root` is an nginx-specific configuration that is coming from somewhere in your template. Consul Template has no nginx-specific configuration and would not automatically add that - it simply isn't smart enough to even know that's a thing. I would be willing to bet that declaration exists in your template as well :smile:."}}