Logstash service not reading config at custom directory - ubuntu-14.04

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.

Related

Installing Apache on Windows Subsystem for Linux

Having just updated to the newest Windows 10 release (build 14316), I immediately started playing with WSL, the Windows Subsystem for Linux, which is supposed to run an Ubuntu installation on Windows.
Maybe I'm trying the impossible by trying to install Apache on it, but then someone please explain me why this won't be possible.
At any rate, during installation (sudo apt-get install apache2), I received the following error messages after the dependencies were downloaded and installed correctly:
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: No such file or directory
runlevel:/var/run/utmp: No such file or directory
* Starting web server apache2 *
* The apache2 configtest failed.
Output of config test was:
mktemp: failed to create directory via template '/var/lock/apache2.XXXXXXXXXX': No such file or directory
chmod: missing operand after '755'
Try 'chmod --help' for more information.
invoke-rc.d: initscript apache2, action "start" failed.
Setting up ssl-cert (1.0.33) ...
Processing triggers for libc-bin (2.19-0ubuntu6.7) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
WARN: / is group writable!
Now, I understand that there seem to be some folders and files missing for Apache2 to work. Before I start changing anything that will mess with my Windows installation, I want to ask whether there's a different way? Also, should I worry about / being group writable or is this just standard Windows behaviour?
In order to eliminate this warning
Invalid argument: AH00076: Failed to enable APR_TCP_DEFER_ACCEP
Add this to the end of /etc/apache2/apache2.conf
AcceptFilter http none
Note the following in your output
failed to create directory via template '/var/lock/apache2.XXXXXXXXXX': No such file
I tried listing /var/lock. It points to /run/lock, which doesn't exist.
Create the directory with
mkdir -p /run/lock
The install should now work (you may need to clean the installation first)
You have to start bash.exe in administrator mode to avoid a lot of problems related to network.
i installed Lamp (Apache/MySQL/Php) without any problem :
Start bash.exe in administrator mode
type : sudo apt-get install lamp-server^
add these 2 lines in /etc/apache2/apache2.conf :
Servername localhost
AcceptFilter http none
then you can start apache :
/etc/init.d/apache2 start
Following the great advice here I edited apache2.conf and inserted the following to end of file after receiving all the various errors above and apache2 then worked great on the debian wsl package:
Servername localhost
AcceptFilter http none
AcceptFilter https none

How to start Logstash config-file

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

Rsyslog central logging separate local logs

I have an Rsyslog central server where multiple machine send log files and these log files are stored by machine IP.
$template DailyPerHostLogs,"/var/log/remote/%fromhost-ip%_%$YEAR%-%$MONTH%-%$DAY%.log"
*.* -?DailyPerHostLogs
This works fine however all the logs gets into the logmachines central logs as well like:
/var/log/messages
/var/log/auth
/var/log/cron
What is the best way to stop this from happening?
Thanks
Solved it, have to put the remote log acception rule first then this:
## before going to local log rules, drop remote logging, it's been
## processed in the "central logging" section
#
:hostname, !isequal, "biglogserver" ~
Then rest of the rsyslog.conf
If I understood your question right, you won't save the logs locally on the machines.
To do that you must remove from /etc/syslog.conf all the lines that describe local log files, and leave there only the line that send the logs remotely.

Where is the log file using Production profile with NServiceBus GenericHost and default log4net settings when installed as a service?

I have a very simple NServiceBus.Host.exe application that is using the default logging and the Production profile. According to the documentation, this should result in an appending file log that should appear in the same folder as the EXE. However, when I run the application as a service, the log file doesn't appear in the same folder as the EXE, and thus far I've been unable to locate it at all. The service is running as Local System. Do I need to run it as a user account and look for the file in the AppData folder somewhere? Is it under c:\windows somewhere? Where is it and is there a way for me to have it actually log to a file in the same folder as the EXE as advertised?
Update:
Using ProcMon and ProcExp from SysInternals, I can see that there is no attempt to create any log file in the folder where my EXE exists, nor are there any file permission errors while trying to create a log file anywhere, at least not from the PID of the service (if for some reason log4net spins up another process to do this work then I might have missed it).
It turns out that the service wasn't actually running in the Production profile. I had for some reason gotten it into my head that services would run in the production profile by default, while running it in interactive mode would use Lite by default. Not so - the service will use the Lite profile unless you specify otherwise. I changed my command to install the service from:
NServiceBus.Host.exe /install /displayName:MyService
to
NServiceBus.Host.exe /install /displayName:MyService NServiceBus.Production
and this fixed the issue.

Can't find mod_authz_svn.so while restarting apache2

I tried to install and setup a svn server using apache2,
I followed instructions on internet but while i tried to restart apache2 it shows the following error:
apache2: Syntax error on line 204 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/authz_svn.load: Cannot load /usr/lib/apache2/modules/mod_authz_svn.so into server: libsvn_repos-1.so.0: cannot open shared object file: No such file or directory
Action 'configtest' failed.
i checked the path but the file do exist,im not sure what is happening.
need some help thanks~
Based on your pathes, it looks like you are playing debian or ubuntu config. if I remember well, this module *mod_authz_svn.so* is available with libapache2-svn, so you need first to apt-get this module as root, and then to enable it (being in the directory /etc/apache2, *a2enmod my_module*) and reload your apache config (or restart apache).
The other way around is to load the module as a DSO. Then it's a different process.

Resources