# How can i start the netflow module through the systemctl

**URL:** <https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162>\
**Category:** Logstash\
**Created:** [December 26, 2017, 1:48am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162 "2017-12-26T01:48:52Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![antony.y](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@antony.y](https://discuss.elastic.co/u/antony.y)\
**Post date:** [December 26, 2017, 1:48am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/1 "2017-12-26T01:48:52Z")

</div>

Hi all, now i can start my netflow module in my logstash through the command line.But i'd like to start it by systemctl.But i failed.

/usr/share/logstash/bin/logstash --modules netflow --setup -M netflow.var.input.udp.port=2055 -M netflow.var.elasticsearch.hosts="[ph71v-esn01.ae007.com:9200](http://ph71v-esn01.ae007.com:9200),[ph71v-esn02.ae007.com:9200](http://ph71v-esn02.ae007.com:9200)" -M netflow.var.kibana.host="[logs.ae007.com:5601](http://logs.ae007.com:5601)" "--path.settings" "/etc/logstash"

When i using the command above , it does work.And the configuration of logstash.service is just like：

[Unit]  
Description=logstash

[Service]  
Type=simple  
EnvironmentFile=-/etc/default/logstash  
EnvironmentFile=-/etc/sysconfig/logstash  
ExecStart=/usr/share/logstash/bin/logstash --modules netflow --setup -M netflow.var.input.udp.port=2055 -M netflow.var.elasticsearch.hosts="[ph71v-esn01.ae007.com:9200](http://ph71v-esn01.ae007.com:9200),[ph71v-esn02.ae007.com:9200](http://ph71v-esn02.ae007.com:9200)" -M netflow.var.kibana.host="[logs.ae007.com:5601](http://logs.ae007.com:5601)" "--path.settings" "/etc/logstash"  
Restart=always  
WorkingDirectory=/  
Nice=19  
LimitNOFILE=16384

[Install]  
WantedBy=multi-user.target

But when i start the service , i can see the error in the log.

[2017-12-26T09:35:32,200][FATAL][logstash.runner] An unexpected error occurred! {:error=\>#\<LogStash::ConfigLoadingError: Failed to parse the module configuration: [Illegal character in authority at index 7: http://"[logs.ae007.com:5601](http://logs.ae007.com:5601)"/api/status]\>, :backtrace=\>["java.net.URI$Parser.fail(java/net/URI.java:2848)", "java.net.URI$Parser.parseAuthority(java/net/URI.java:3186)", "java.net.URI$Parser.parseHierarchical(java/net/URI.java:3097)", "java.net.URI$Parser.parse(java/net/URI.java:3053)", "java.net.URI.(java/net/URI.java:588)", "org.apache.http.client.utils.URIBuilder.(org/apache/http/client/utils/URIBuilder.java:82)", "java.lang.reflect.Constructor.newInstance(java/lang/reflect/Constructor.java:423)", "RUBY.uri\_from\_url\_and\_options(/usr/share/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/client.rb:450)", "RUBY.request\_from\_options(/usr/share/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/client.rb:457)", "RUBY.request(/usr/share/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/client.rb:418)", "RUBY.get(/usr/share/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/client.rb:246)", "RUBY.http(/usr/share/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/client.rb:300)", "RUBY.safely(/usr/share/logstash/logstash-core/lib/logstash/modules/kibana\_client.rb:112)", "RUBY.get(/usr/share/logstash/logstash-core/lib/logstash/modules/kibana\_client.rb:89)", "RUBY.initialize(/usr/share/logstash/logstash-core/lib/logstash/modules/kibana\_client.rb:64)", "RUBY.pipeline\_configs(/usr/share/logstash/logstash-core/lib/logstash/config/modules\_common.rb:73)", "org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)", "RUBY.pipeline\_configs(/usr/share/logstash/logstash-core/lib/logstash/config/modules\_common.rb:56)", "RUBY.execute(/usr/share/logstash/logstash-core/lib/logstash/runner.rb:276)", "RUBY.run(/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67)", "RUBY.run(/usr/share/logstash/logstash-core/lib/logstash/runner.rb:204)", "RUBY.run(/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132)", "usr.share.logstash.lib.bootstrap.environment.(root)(/usr/share/logstash/lib/bootstrap/environment.rb:71)", "usr.share.logstash.lib.bootstrap.environment.(root)(usr/share/logstash/lib/bootstrap//usr/share/logstash/lib/bootstrap/environment.rb:71)"]}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 26, 2017, 2:11am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/2 "2017-12-26T02:11:20Z")

</div>

How did you install Logstash?

---

<div class="post-metadata">

**Author:** ![antony.y](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@antony.y](https://discuss.elastic.co/u/antony.y)\
**Post date:** [December 26, 2017, 2:13am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/3 "2017-12-26T02:13:24Z")

</div>

Through the RPM.  
I just want to add some parameters to start the netflow module, but it does not work

---

<div class="post-metadata">

**Author:** ![antony.y](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@antony.y](https://discuss.elastic.co/u/antony.y)\
**Post date:** [December 26, 2017, 2:29am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/4 "2017-12-26T02:29:32Z")

</div>

I have found the solution,I think it's the problem of format.When i changing the service file as following , it does work!

ExecStart=/usr/share/logstash/bin/logstash --modules netflow --setup -M netflow.var.input.udp.port=2055 -M "[netflow.var.elasticsearch.hosts:9200=ph71v-esn01.ae007.com](http://netflow.var.elasticsearch.hosts:9200=ph71v-esn01.ae007.com),[ph71v-esn02.ae007.com:9200](http://ph71v-esn02.ae007.com:9200)" -M "[netflow.var.kibana.host:5601=logs.ae007.com](http://netflow.var.kibana.host:5601=logs.ae007.com)" "--path.settings" "/etc/logstash"

Have you found the difference ? The location of the double quotation marks is important .  
But until now i do not know the reason,is there anyone can help me to answer it ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 26, 2017, 4:13am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/5 "2017-12-26T04:13:08Z")

</div>

Why not just use the included service file?

---

<div class="post-metadata">

**Author:** ![antony.y](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@antony.y](https://discuss.elastic.co/u/antony.y)\
**Post date:** [December 26, 2017, 6:17am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/6 "2017-12-26T06:17:56Z")

</div>

I am indeed using the included service file,but i need to add some parameters to start the netflow module....

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 26, 2017, 6:20am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/7 "2017-12-26T06:20:47Z")

</div>

You shouldn't need to edit the service file directly, have a look at [https://www.elastic.co/guide/en/logstash/current/running-logstash.html](https://www.elastic.co/guide/en/logstash/current/running-logstash.html)

---

<div class="post-metadata">

**Author:** ![antony.y](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@antony.y](https://discuss.elastic.co/u/antony.y)\
**Post date:** [December 26, 2017, 6:23am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/8 "2017-12-26T06:23:23Z")

</div>

Maybe you misunderstood my meaning, i am indeed using the service file directly.But if you do not add any parameter in that file , you can not use netflow module in the logstash.That is why i add some parameters in the service file...

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 26, 2017, 6:27am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/9 "2017-12-26T06:27:42Z")

</div>

There are configuration files that this needs to live in, not the service file.

Look at `/etc/logstash/startup.options`, specifically the `LS_OPTS` section.

---

<div class="post-metadata">

**Author:** ![antony.y](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@antony.y](https://discuss.elastic.co/u/antony.y)\
**Post date:** [December 26, 2017, 6:31am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/10 "2017-12-26T06:31:31Z")

</div>

i will try that first , thank you

---

<div class="post-metadata">

**Author:** ![antony.y](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@antony.y](https://discuss.elastic.co/u/antony.y)\
**Post date:** [December 26, 2017, 7:34am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/11 "2017-12-26T07:34:46Z")

</div>

Wow , it does work, no i do not need to add any parameters in the service file, i only need to add "--setup" in the startup.yml , then i can start the netflow module  
Thank you so much Warkolm:grinning:

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 26, 2017, 7:35am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/12 "2017-12-26T07:35:28Z")

</div>

No worries, glad we got it sorted in the end 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 23, 2018, 7:36am UTC](https://discuss.elastic.co/t/how-can-i-start-the-netflow-module-through-the-systemctl/113162/13 "2018-01-23T07:36:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
