I am pulling a JSON input via http_poller, the data has "\n" throughout the data that I would like to remove it
Here is an example of a date that contains the "\n"
"O 151007Z FEB 17\n"
Here is my input
input{
http_poller{
urls => {
test1 => "..."
test2 => {
method => get
url => "..."
headers => {
Accept => "application/json"
}
}
}
codec => "json"
}
}
I have tried
filter{
mutate { gsub => [ "message", "[\n]", "" ] }
}
and suggestions from here with no success.
Hi,
I am trying to ingest Java exceptions into Elasticsearch via logstash.
In Kibana, they show up like this,
\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)\n\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)\n\tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)\n\tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)\n\tat org.apache.tomcat.util.net.NioEndpo…
Badger
April 5, 2019, 4:36pm
2
Do not escape the newline.
mutate { gsub => [ "message", "
", "" ] }
My new input is
input {
http_poller {
urls => {
test1 => ".."
test2 => {
method => get
url => "..."
headers => {
Accept => "application/json"
}
}
}
type => "..."
request_timeout => 60
codec => "json"
metadata_target => "http_poller_metadata"
}
}
filter {
json {
source => "message"
}
mutate { gsub => [ "messages", "
", "" ] }
}
The output has not changed and is
"O 151007Z FEB 17\n"
In Kibana, the "\n" is only visible in the JSON source, but it causes issues when trying to parse the date as I am only able to parse dates without the new line \n "O 151007Z FEB 17" correctly.
system
(system)
Closed
May 3, 2019, 6:10pm
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.