Hi Masters,
I'm trying to use Logsash with "elasticsearch" input for taking specific events from winlogbeat Index and write them to another Index,
I have a problem with the "query" on the input section,
when I'm trying to query something except this:
query => '{ "query": { "query_string": { "query": "*" } } }'
im getting EROORs or Logstsash failed to start.
Examples of failures:
query => '{ "query": { "query_string": { "event_id" : "3" } } }'
query => '{ "query": { "query_string": { "event.id": 3 } } }'
query => '{"query": {"query_string": {"fields": ["event.id","content"],"query": "4625 OR 4624 OR 3"}}}'
query => '{ "query": { "match": { "event.code": "4625" } } }'
query => '{ "query": { "match": { "statuscode": 200 } }, "sort": [ "_doc" ] }'
query => '{ "query": { "match": { "event.id": 4625 } } }'
query => '{ "query": { "match": { "event.code": 4625 } }, "sort": [ "_doc" ] }'
query => '{ "query": {"query_string": {"query": "event.code:"4625"","fields": ["event.code"]}}}'
query => '{"query": {"bool":{"should":[{"term":{"host.raw":"host 1"}},{"term":{"host.raw":"host 2"}}], "must_not":{"term":{"code":"123"}}}}}'
query => '{"query": {"bool":{"should":[{"term":{"event.id":"4624"}},{"term":{"event.id":"4625"}}], "must_not":{"term":{"event.id":"123"}}}}}'
conf file:
input {
elasticsearch {
hosts=>["elk01:9200"]
index => "winlogbeat-2021.04.09-000453"
#WORK#query => '{ "query": { "query_string": { "query": "*" } } }'
query => '{ "query": { "query_string": { "event_id" : "3" } } }'
size => 500
scroll => "5m"
docinfo => true
ca_file => '/etc/logstash3/config/certs/ca.crt'
ssl => true
user => 'user'
password => '123456'
}
}
output {
elasticsearch {
index => "winlogbeat-2021.04.09-000453-copy"
hosts => ["https://elk01:9200"]
cacert => '/etc/logstash3/config/certs/ca.crt'
user => 'user'
password => '123456'
}
}
any help will very appreciated