How to start Logstash config-file - logstash

i have a problem with logstash when i want to start from my config file with the command"bin/logstash -f logstash-rt.conf"
this return:
Error: No config files found: logstash-rt.conf
Can you make sure this path is a logstash config file?
You may be interested in the '--configtest' flag which you can
use to validate logstash's configuration before you choose
to restart a running system.
can someone help me ?
Thanks

You need to put config file in logstash folder and the path should be of the logstash folder when you execute the command
so bin/logstash is the relative path when you run it where the conf file is.

Make a .config file and then paste it into the bin folder of Logstash and then use the below command in cmd to start it
logstash -f filename.config

Below is the command to load logstash.conf
sudo bin/logstash -f apache.config --config.reload.automatic --path /etc/logstash/conf.d/filter.conf

Related

how the baseline scan runs with a configuration file. Where is the file how we can use in with docker and commands

Am using zap Baseline Scan i want to Change WARN to Ignore Rules. I don't have idea what is Configuration File and how i can use it in my command line when i am using ZAP docker image. I am Using Docker to run passive scan by command and generating report.
Per the published docs, https://www.zaproxy.org/docs/docker/baseline-scan/ :
-g gen_file generate default config file (all rules set to WARN)
It's just a text file so edit it and use it:
-c config_file config file to use to INFO, IGNORE or FAIL warnings
-u config_url URL of config file to use to INFO, IGNORE or FAIL warnings
For example:
docker run -v $(pwd):/zap/wrk/:rw -t owasp/zap2docker-stable zap-baseline.py -t https://www.example.com -c /zap/wrk/my.conf -r /zap/wrk/testreport.html
Where my.conf is in the mapped pwd, then the report is written there as well.

Error autostarting Linux service after reboot if condition is met: "Path in condition not absolute, ignoring"

I have a service named MyService that needs to auto-start a NodeJS process only if "Configured!" can be found inside of a configuration file. The MyService.service file contains the following in the Service section:
ExecStart=/usr/bin/sh -c "if grep -q 'Configured!' /path/to/configuration/file.conf; then /usr/bin/node /path/to/node/process.js; fi"
However, the problem is that the NodeJS process does not auto-start. In fact, when I look in journalctl, I see the following error message:
Path in condition not absolute, ignoring: "/path/to/configuration/file.conf"
How can I please change ExecStart to successfully auto-start the NodeJS process when the condition has been met? This is very puzzling because when I run the ExecStart command on the command line, it works correctly. Also, the path to the configuration file is an absolute path.
(Also, please note that since this machine is running an old version of systemd, I am not able to use ExecCondition.)
The issue is with double quotes in :
"/path/to/configuration/file.conf"
which makes systemd think it's not a absolute path.

How to run multiple logstash on same host

I want to run multiple logstash on same host but i dont know how make configure.
Who is step by step tell me for make configure ?
Thank you for interest.
You can tell logstash where to get the config file on the command line:
bin/logstash -f config1.conf
Start a second one with a different config file:
bin/logstash -f config2.conf
If you want to do this from startup, you would need to configure separate initd/systemd for each desired process.
Can you explain what your use case is? Logstash can handle multiple inputs and some pretty complex configurations with just one process.

Logstash service not reading config at custom directory

I'm trying to set up Logstash as a service on an Ubuntu 14.04 server and want it to read my configuration from a series of files that are in a directory that isn't the default /etc/logstash/conf.d I've edited /etc/init.d/logstash so that LS_CONF_DIR is the directory I want instead of the default. When I run "service logstash configtest" I get a reply saying the configuration is OK, but when I try to start the service it doesn't work and I get the following errors in debug mode:
{:timestamp=>"2016-06-08T16:35:05.729000-0400", :message=>"translation missing: en.logstash.runner.configuration.file-not-found", :level=>:error, :file=>"logstash/agent.rb", :line=>"383", :method=>"create_pipeline"}
{:timestamp=>"2016-06-08T16:35:05.738000-0400", :message=>"starting agent", :level=>:info, :file=>"logstash/agent.rb", :line=>"207", :method=>"execute"}
I've checked permissions on the files and all user have read permission. When I run logstash from the command line with -f pointing to the directory, it runs fine.

MySQL backup with CronJOb

I am trying to export MySQL data with CronJob in cPanel and I am adding bellow code into command line:
/usr/bin/mysqldump --opt -u krystald_fred -p'tY$645=&nm' max_joomla > /home/max/db-backup.sql
After CronJob runs and when I check db-backup.sql file I am getting blank file with no data inside .sql file.
What's wrong with this command line. Can anyone guide me to fix this.
Thanks.
Not enough info there. There could be many issues. Just run from command line with -v verbose flag and see. You might also need to connect via the 3306 port and specify hostname. It all depends on your installation.

Resources