Open realrobmorris opened 8 years ago
changed up the logstash.conf file.
input {
beats {
port => 5044
}
}
filter {
grok {
match => [ "message", "%{GREEDYDATA:message}"]
}
}
output {
stdout {
codec => rubydebug
}
elasticsearch {
hosts => "<ip>:9200"
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
document_type => "%{[@metadata][type]}"
}
if "OMG" in [message] {
email {
from => "logstash@<host>"
subject => "logstash alert"
to => "<user>@<host>"
via => "sendmail"
body => "Here is the event line that occured: %{message}"
}
}
}
by the way, this is what the logstash.stdout says:
{
"message" => [
[0] "Jun 17 14:07:58 <nodehost_redacted> root: This is another message ERROR WARN OMG",
[1] "Jun 17 14:07:58 <nodehost_redacted> root: This is another message ERROR WARN OMG"
],
"@version" => "1",
"@timestamp" => "2016-06-17T18:08:03.667Z",
"type" => "log",
"beat" => {
"hostname" => "<host_redacted>",
"name" => "<host_redacted>"
},
"source" => "/var/log/messages",
"offset" => 56471433,
"fields" => nil,
"input_type" => "log",
"count" => 1,
"host" => "<host_redacted>",
"tags" => [
[0] "beats_input_codec_plain_applied"
]
}
So there seems to be an @timestamp
in the logstash.stdout ; so why would the elasticsearch/logstashTesting.log file have the error:
[indices:data/read/field_stats[s]]]; nested: IllegalArgumentException[field [@timestamp] doesn't exist];
Caused by: java.lang.IllegalArgumentException: field [@timestamp] doesn't exist
I am getting this as well! Started last week and takes ages to search for data.. even opening the default site and viewing all logs with default '*' (star)...
By looking at this /var/log/elasticsearch/cluster01.log I can see Marvel is having an issue?
[2016-07-02 12:24:03,545][DEBUG][action.fieldstats ] [kib02] [.marvel-es-1-2016.07.02][0], node[0FBqNX3jQbaHx0S9Ko0sMQ], [P], v[3], s[STARTED], a[id=Q7p1dpI4Qcip2Yc2SjhYGA]: failed to execute [org.elasticsearch.action.fieldstats.FieldStatsRequest@6965d5ba] RemoteTransportException[[els04][192.168.10.24:9300][indices:data/read/field_stats[s]]]; nested: IllegalArgumentException[field [@timestamp] doesn't exist]; Caused by: java.lang.IllegalArgumentException: field [@timestamp] doesn't exist at org.elasticsearch.action.fieldstats.TransportFieldStatsTransportAction.shardOperation(TransportFieldStatsTransportAction.java:166) at org.elasticsearch.action.fieldstats.TransportFieldStatsTransportAction.shardOperation(TransportFieldStatsTransportAction.java:54) at org.elasticsearch.action.support.broadcast.TransportBroadcastAction$ShardTransportHandler.messageReceived(TransportBroadcastAction.java:282) at org.elasticsearch.action.support.broadcast.TransportBroadcastAction$ShardTransportHandler.messageReceived(TransportBroadcastAction.java:278) at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:75) at org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.doRun(MessageChannelHandler.java:300) at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
have you figured this out?
Hi DeadPirateRob. Data that I had in my ES was not important so I deleted everything with this command: curl -XDELETE 'http://localhost:9200/_all' I also posted my problem here.. https://discuss.elastic.co/t/default-and-marvel-index-are-throwing-java-errors-about-timestamp-not-existing/54591/1
So no not really fixed but at least I have a workaround (be it a hack) :)
ok, fyi I changed up my logstash file, it now looks like this:
input {
beats {
port => 5044
type => "syslog"
}
}
filter {
if [type] == "syslog" {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
}
syslog_pri { }
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
}
}
output {
stdout { codec => rubydebug }
elasticsearch {
hosts => "<ip_redacted>:9200"
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
document_type => "%{[@metadata][type]}"
}
if "OMG" in [message] {
email {
to => "user_email@host.com"
from => "logstash.alert@host.com"
via => "sendmail"
subject => "ELK Syslog Alert concerning %{host}"
body => "This syslog has an interesting string and thus picked up on host (%{host}). Via this message: %{message}"
}
}
}
I haven't seen the error happen again, and the email sending is working correctly.
as an update, its still working well.
Putting this here because there's been no replies in the forums.
First time user of ELK, originally I created an issue against elasticsearch on github, but it was suggested that I bring this issue to this forum, and so here we are.
In my /var/log/elasticsearch/logstashTesting.log file, all I have are entries that begin with this.
[indices:data/read/field_stats[s]]]; nested: IllegalArgumentException[field [@timestamp] doesn't exist]
Elasticsearch (ELK) version:
JVM version:
OS version:
Provide logs (if relevant):
logstash config file
elasticsearch config file
kibana config file
Question: So what's going on here? (also, logstash isn't sending the email when the match is found)
Also, FYI.
This am I removed the
manage_template => false
from the logstash config file, but I'm still getting the same error. Here's what elasticsearch/logstashTesting.log says.