Logstash Heroku plugin credentials

I am trying to fetch the Heroku app logs into elastic search using the Heroku input plugin.I am able to successfully get the logs into elastic search if I run the logstash from the bin by passing the config.
But when I try to run logstash as a Service , then I get an entry in the logstash logs for username and password of heroku and logstash service stops.The .netrc file exists and it has the credentials.
Please let me know how to resolve this.