Giter VIP home page Giter VIP logo

Comments (6)

naisanza avatar naisanza commented on July 20, 2024

+1

from logstash-filter-grok.

jordansissel avatar jordansissel commented on July 20, 2024

This kind of log pattern key=value key2=value2 key3=value3 is best processed with the kv filter.

from logstash-filter-grok.

jordansissel avatar jordansissel commented on July 20, 2024

I am confident that the kv filter should help with this kind of log format, so I will close this. If you have trouble using the kv filter on this kind of log, please let us know at https://discuss.elastic.co/ and the community should be able to help you move forward :)

from logstash-filter-grok.

Arikius avatar Arikius commented on July 20, 2024

KV is Irrelevant here if you have spaces

from logstash-filter-grok.

jordansissel avatar jordansissel commented on July 20, 2024

@Arikius indeed; kv filter has some limitations. Is there something specific you need here? Or can you open a new issue?

from logstash-filter-grok.

simplyviks avatar simplyviks commented on July 20, 2024

echo '{"name":"Demo:Verify call home DPU","suit":"nbi-callhome","status":"Passed","error":"ssh failed","critical":"Yes","duration":9.9133,"tag":"UT5","build":0,"Type":"AT"}' | ./bin/logstash -f logstash.conf

want out as below:

name:DemocVerify call home DPU
suit:nbi-callhome
status:Passed
error:ssh failed
critical:Yes
duration:9.9133
tag:UT5
build:0,
Type:AT

Please help me with the logstash.conf for the same.

output i am getting is:

[root@host-135-249-42-199 logstash-5.1.1]# echo '{"name":"Demo:Verify call home DPU","suit":"nbi-callhome","status":"Passed","error":"ssh failed","critical":"Yes","duration":9.9133,"tag":"UT5","build":0,"Type":"AT"}' | ./bin/logstash -f logstash.conf
Sending Logstash's logs to /root/Logstash/logstash-5.1.1/logs which is now configured via log4j2.properties
[2017-01-13T19:49:11,720][INFO ][logstash.pipeline ] Starting pipeline {"id"=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>500}
[2017-01-13T19:49:11,762][INFO ][logstash.pipeline ] Pipeline main started
{
"@timestamp" => 2017-01-13T14:19:11.553Z,
"@Version" => "1",
"host" => "host-135-249-42-199",
"message" => "{"name":"Demo:Verify call home DPU","suit":"nbi-callhome","status":"Passed","error":"ssh failed","critical":"Yes","duration":9.9133,"tag":"UT5","build":0,"Type":"AT"}",
"body" => "{"name":"Demo:Verify call home DPU","suit":"nbi-callhome","status":"Passed","error":"ssh failed","critical":"Yes","duration":9.9133,"tag":"UT5","build":0,"Type":"AT"}",
"tags" => []
}

logstash.conf i am using:

input { stdin {} }

filter {
grok {
match => [ "message", "%{GREEDYDATA:body}"]
}
kv { source => "message" }
}
output { stdout { codec => rubydebug } }

Thanks in Advance!!

from logstash-filter-grok.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.