I'm following this documentation https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-apache2.html in order to connect an apache web server access log file using file beat to elasticsearch, everything was ok until I changed the path of apache2.yml I got the following error :
2018-09-22T14:21:55.791+0100 ERROR instance/beat.go:691 Exiting: 1 error: error
loading config file: invalid config: yaml: line 3: found unknown escape character
Exiting: 1 error: error loading config file: invalid config: yaml: line 3: found unknown escape character
this id apache2.yml configuration file :
- module: apache2
access:
enabled: true
var.paths: ["C:\Program Files\filebeat-6.3.2-windows\logs\Apache\Access.log"]
If you are using double quotes in
"C:\Program Files\filebeat-6.3.2-windows\logs\Apache\Access.log"
you need to escape the backslash characters
"C:\\Program Files\\filebeat-6.3.2-windows\\logs\\Apache\\Access.log"
Use / instead of . \ is used to escape characters.
I had the same problem
Related
I am quite new to the Elastic stack and trying to experiment with visualization of apache log files in Kibana. I am using filebeat to ingest the apache logs. However when I run .\filebeat.exe setup -e, I get the following error:
2019-02-05T20:53:10.515+0530 INFO elasticsearch/client.go:165 Elasticsearch url: http://localhost:9200
2019-02-05T20:53:10.520+0530 INFO elasticsearch/client.go:721 Connected to Elasticsearch version 6.6.0
2019-02-05T20:53:10.520+0530 INFO kibana/client.go:118 Kibana url: http://localhost:5601
2019-02-05T20:53:10.567+0530 WARN fileset/modules.go:388 X-Pack Machine Learning is not enabled
2019-02-05T20:53:10.572+0530 ERROR instance/beat.go:911 Exiting: 1 error: error loading config file: invalid con
fig: yaml: line 4: did not find expected hexdecimal number
My filebeat.yml file looks like this:
filebeat.inputs:
- type: log
enabled: true
paths: C:\Users\bigdataadmin\Downloads\ApacheLogs\*
#============================= Filebeat modules ===============================
filebeat.config.modules:
path: C:\Program Files\Filebeat\modules.d\*.yml
reload.enabled: true
reload.period: 60s
#==================== Elasticsearch template setting ==========================
setup.template.settings:
index.number_of_shards: 3
setup.kibana:
host: "localhost:5601"
output.elasticsearch:
hosts: ["localhost:9200"]
# Configure processors to enhance or manipulate events generated by the beat.
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
I also checked the yml on http://www.yamllint.com/ but didn't find any problems. I can't seem to figure out what's wrong with line 4 of this file.
I am using filebeat 6.6
The path key(on line 4) is an array. So you need to represent an array there.
Example :
filebeat.inputs:
- type: log
enabled: true
paths:
- C:\Users\bigdataadmin\Downloads\ApacheLogs\*
Please be very cautious about the data type you are representing in such config files, I had made the same mistake while I was working on Filebeat and I had to spend a lot of time for a small mistake...
I downloaded the setup from official site and executed ./setup.py but got following error
File "./setup.py", line 54
print "Error when creating opscenter SSL files. Error was:\n"
^
SyntaxError: Missing parentheses in call to 'print'
any alternatives?
Telegraf version: Telegraf v1.0.1
I have the following files:
/etc/telegraf/telegraf.conf
main config file (which you create/get for free while installing telegraf). This file doesn't have any [[output.<plugin>]] stanza in it but does have valid default inputs.xx plugins enabled.
/etc/telegraf/telegraf.d/1-company-output-plugin.conf
(This file has valid outputs.<pluginname> plugin).
/etc/telegraf/telegraf.d/telegraf-additional-inputs-plugins.conf
(this file has additional inputs.<pluginname> plugins that I want to keep separate from the main conf file).
Running sudo service telegraf status shows Telegraf is running [OK]! and log file /var/log/telegrag/telegraf.log (looks good too without showing any errors).
If I make any changes to one of the above configuration files, I want to test those changes made (before I restart telegraf), so I'm running the following commands with -test or --test option but I'm getting the following error:
ubuntu#jenkins:~/test_aks_dir$ telegraf --config /etc/telegraf/telegraf.conf -test
2017/01/10 22:45:48 E! Error: no outputs found, did you provide a valid config file?
ubuntu#jenkins:~/test_aks_dir$ telegraf --config /etc/telegraf/telegraf.conf --test
2017/01/10 22:45:51 E! Error: no outputs found, did you provide a valid config file?
As you see above, both optons -test or --test worked but also gave a valid error message above.
As the above error was for not providing any configuration stanza for [[outputs.<plugin>]], I provided another --config file paramter for the file which contains the outputs plugin stanza, but now it gave an error for the missing inputs. file:
ubuntu#jenkins:~/test_aks_dir$ telegraf --config /etc/telegraf/telegraf.conf --config /etc/telegraf/telegraf.d/1-company-output-plugin.conf --test
2017/01/10 22:48:30 E! Error: no inputs found, did you provide a valid config file?
ubuntu#jenkins:~/test_aks_dir$
Note: The above command didn't error for providing multiple --config <someConfigFile> parameter values.
The same error comes if I want to test any change in the 3rd file : (/etc/telegraf/telegraf.d/telegraf-additional-inputs-plugins.conf)
How can I test an individual or selective configuration file changes using telegraf assuming I have multiple files here: /etc/telegraf/telegraf.d/*.conf ?
this is not possible at the moment, the only way to do it would be to specify the entire config directory
I am using this github repo to understand the working of Berkshelf when used along with Amazon Opsworks. The basic idea behind what i am trying is if i mention apache2 as a dependency in berksfile for my phpapp recipe then it will automatically manage the dependencies for apache2 which itself is a dependency for phpapp. when i try this with AWS opsworks i get the following error.
================================================================================
Error executing action `run` on resource 'execute[enable mod_proxy for apache-tomcat binding]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /usr/sbin/a2enmod proxy ----
STDOUT:
STDERR: ERROR: Module proxy does not exist!
---- End output of /usr/sbin/a2enmod proxy ----
Ran /usr/sbin/a2enmod proxy returned 1
Resource Declaration:
---------------------
# In /var/lib/aws/opsworks/cache.stage2/cookbooks/opsworks_java/recipes/apache_tomcat_bind.rb
1: execute 'enable mod_proxy for apache-tomcat binding' do
2: command '/usr/sbin/a2enmod proxy'
3: not_if do
4: ::File.symlink?(::File.join(node['apache']['dir'], 'mods-enabled', 'proxy.load')) || node['opsworks_java']['tomcat']['apache_tomcat_bind_mod'] !~ /\Aproxy/
5: end
6: end
7:
Compiled Resource:
------------------
# Declared in /var/lib/aws/opsworks/cache.stage2/cookbooks/opsworks_java/recipes/apache_tomcat_bind.rb:1:in `from_file'
execute("enable mod_proxy for apache-tomcat binding") do
action "run"
retries 0
retry_delay 2
command "/usr/sbin/a2enmod proxy"
backup 5
returns 0
cookbook_name "opsworks_java"
recipe_name "apache_tomcat_bind"
not_if { #code block }
end
Add metadata insted of cookbook "apache2" to your Berksfile, with that in place Berkshelf will add your local cookbook to list of local cookbooks, and it's dependencies from metadata.rb
From berkshelf.com:
The metadata keyword is like saying gemspec in Bundler’s Gemfile. It says,
“There is a metadata.rb file within the same relative path of my Berksfile”.
This allows you to resolve a Cookbook’s dependencies that you are currently
working on just like you would resolve the dependencies of a Gem that
you are currently working on with Bundler.
Here is similar issue.
In ubuntu server when I try to start apache it gives following error message.
apache2: Syntax error on line 210 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/mods-enabled/proxy_scgi.load: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
What is the reason for the error? And how can I get through this issue?
This issue can be fixed by enabling the proxy_scgi module. Following is the command to enable the module in linux.
sudo a2enmod proxy_scgi