pkshara
(Akshara)
September 14, 2017, 5:52pm
1
Below is the error log:
[Mon Nov 28 04:38:24 2016] [error] [client 10.114.34.43] File does not exist: /fep10/oraapps/appl/fep10comn/portal/FEP10_j201s648/favicon.ico
I had written grok pattern as
"message"=> "[(?%{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{YEAR})] [%{LOGLEVEL:loglevel}] [client %{IP:clientip}:.*] %{GREEDYDATA:errormsg}"
It gives an grokparsefailure in ES. Please suggest the appropriate and let me know where i am making mistake.
TIA
Please edit your post and format the grok expression as preformatted text (e.g. using the toolbar button) so that it doesn't get mangled.
phegde
(Pratheek Hegde)
September 14, 2017, 6:10pm
3
I'm trying out with nginx and even I get _grokparsefailure
error along with _geoip_lookup_failure
.
Here is my conf.
filter
{
if [type] == "nginx"
{
grok {
match => {
"message" => '%{IPORHOST:remote_ip} - %{DATA:user_name} \[%{HTTPDATE:time}\] "%{WORD:request_action} %{DATA:request} HTTP/%{NUMBER:http_version}" %{NUMBER:response} %{NUMBER:bytes} "%{DATA:referrer}" "%{DATA:agent}"'
}
}
date {
match => [ "time", "dd/MMM/YYYY:HH:mm:ss Z" ]
locale => en
}
geoip {
source => "remote_ip"
target => "geoip"
}
useragent {
source => "agent"
target => "user_agent"
}
}
}
But that's your access log filters and you wanted help with your error log.
phegde
(Pratheek Hegde)
September 15, 2017, 5:21am
5
Oh Sorry I forgot to mention were the errors were shown. Actually it shows up in KIBANA.
pkshara
(Akshara)
September 15, 2017, 6:08am
7
Can you be more clear how to do it, As i am very new to this . I dont understand it easily
pkshara
(Akshara)
September 15, 2017, 6:13am
9
[Mon Nov 28 04:38:24 2016] [error] [client 10.114.34.43] File does not exist: /fep10/oraapps/appl/fep10comn/portal/FEP10_j201s648/favicon.ico
Grok Pattern for the above error.
magnusbaeck
(Magnus Bäck)
September 15, 2017, 7:47am
10
Okay. Then please provide the things I asked for in the bullet list a few posts up.
pkshara
(Akshara)
September 15, 2017, 8:07am
11
The output which i get,
message:[Mon Nov 28 04:42:21 2016] [error] [client 10.114.34.43] client denied by server configuration: /fep10/oraapps/appl/fep10comn/java/oracle/forms/engine
@version :1
@timestamp :14/9/2017 23:02:06 PM
host:j051s319.jci.com
path:/data/Ops_analytics_EBS/oracle_ebs_eu/j201s648/apacheerror.log
type:logs
tags:_grokparsefailure
_id:AV6Bcqn7o5C-nkf485it
_type:logs
_index:logstash_parsing_error_index
_score:1
magnusbaeck
(Magnus Bäck)
September 15, 2017, 10:44am
12
Sorry, I don't have time for this when you never provide all information I ask for. Maybe someone else has more patience.
pkshara
(Akshara)
September 15, 2017, 1:04pm
13
Code :
input {
file {
path => "/data/Ops_analytics_EBS/oracle_ebs_eu/j201s648/error_20170913.log"
start_position => "beginning"
type => "apache_error"
}
}
filter {
grok {
match =>["message","[(?%{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{YEAR})] [%{LOGLEVEL:loglevel}] [client %{IP:clientip}:.*] %{GREEDYDATA:errormsg}"]
add_field => {
"eventName"=> "grok"
}
}
geoip {
source => "clientip"
}
}
output {
elasticsearch {
hosts => "localhost:9200"
index => "logstash_parsing_error_index"
}
}
The Error log which i want to push in ES is
[Mon Aug 22 02:41:35 2016] [error] [client 10.96.159.140] File does not exist: /fep10/oraapps/appl/fep10comn/portal/FEP10_j201s648/favicon.ico
The output which is being indexed in ES or logstash screen is
message:[Mon Nov 28 04:42:21 2016] [error] [client 10.114.34.43] client denied by server configuration: /fep10/oraapps/appl/fep10comn/java/oracle/forms/engine
@version :1
@timestamp :14/9/2017 23:02:06 PM
host:j051s319.jci.com
path:/data/Ops_analytics_EBS/oracle_ebs_eu/j201s648/apacheerror.log
type:logs
tags:_grokparsefailure
_id:AV6Bcqn7o5C-nkf485it
_type:logs
_index:logstash_parsing_error_index
_score:100:
I want the output in a format where each part of error should be aligned to the data_name which is mentioned in grok pattern .
n would like to know the cause of _grokparsefailure as well.
You have a :
after the client
pattern which does not seem to match the entry. What happens if you remove this?
1 Like
pkshara
(Akshara)
September 15, 2017, 1:23pm
15
It does cleared grokparsefailure error. tnx for that .
I want my error-time to converted in time format. It is getting stored as string. Can you plz guide me where i am going wrong.
Is there any regex pattern where i can convert string into timestamp format?
You should use a date
filter to process the date and get it into the right format.
pkshara
(Akshara)
September 15, 2017, 1:31pm
17
Thanks for the suggestion , I used date filter before only , now added target in date filter and it works fine
system
(system)
Closed
October 13, 2017, 1:31pm
18
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.