GithubHelp home page GithubHelp logo

Comments (3)

MikeKemmerer avatar MikeKemmerer commented on June 19, 2024

This is expected behavior. The slash you’re using is escaping the doublequote inside of the doubleqoute encapsulated string. Try using 3 \ characters (one more to escape the slash and another to escape the quote).

from logstash-filter-http.

andsel avatar andsel commented on June 19, 2024

@MikeKemmerer I would agree with you if the generator used the the double quotes:

message => "{\"Field1\": \"22222wwwww\"www\"wwwwww\"}"

but however to have to be right it should have quoted also the quote character like in:

message => "{\"Field1\": \"22222wwwww\\\"www\\\"wwwwww\"}"

but is uses the single quote:

message => '{"Field1": "22222wwwww\"www\"wwwwww"}'

Replacing the HTTP filter with HTTP output

output {
  http {
    ecs_compatibility => "disabled"
    http_method => "post"
    url => "http://localhost:8080"
  }
}

Behaves like expected on WireMock

Connection: [keep-alive]
Content-Type: [application/json]
Content-Length: [206]
Host: [localhost:8080]
User-Agent: [Manticore 0.9.1]
Accept-Encoding: [gzip,deflate]
{"Field1":"22222wwwww\"www\"wwwwww","@version":"1","event":{"original":"{\"Field1\": \"22222wwwww\\\"www\\\"wwwwww\"}","sequence":0},"host":{"name":"kalimera"},"@timestamp":"2023-02-28T15:25:13.743720606Z"}

from logstash-filter-http.

andsel avatar andsel commented on June 19, 2024

@MikeKemmerer you are right the json

{"Field1": "22222wwwww\"www\"wwwwww"}

is a valid json, on which the Field1 contains the string with a couple of double quotes, and those double quotes needs to be quoted to be represented in json: 22222wwwww"www"wwwwww

from logstash-filter-http.

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.