I cannot start logstash

1.I tried to do this

sudo /usr/share/logstash/bin/system-install /etc/logstash/startup.options systemd

The output is

Using provided startup.options file: /etc/logstash/startup.options Manually creating startup for specified platform: systemd Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c53 30000, 986513408, 0) failed; error='Cannot allocate memory' (errno=12) /usr/share/logstash/bin/system-install: line 88: #: command not found Unable to install system startup script for Logstash.

  1. I tried to do this

/usr/share/logstash/bin/system-install

The output is

/usr/share/logstash/bin/system-install: line 45: : No such file or directory

Does any solution please?

I just replied to this thread please keep refrain from asking the same question multiple times and give people a change to respond.