Logstash not parsing the stacktrace into JSON format

I have got two questions here.

  1. Can we configure such a way that the logs generated by the application are parsed without giving input to log statsh and save as JSON format into the logs. Here we can have only one file to save the date and contradict to two files below input and output. As I want to save the logs into a single file I was think whether this approach of directly parsing and applying codecs can be done at the app configutation and the below whitespaces and special chars are removed and saved to the log file.

  2. I like to give an input as file to logstash and output the parse JSON format into a file with whitespaces(\t), new line (\n) removed and special charecters(\) . But these characters are seen inside the logs even though below config is applied

    input {
    file {
    path => "/home/nikb/Desktop/mylogs.log"
    codec => multiline {
    what => "previous"
    }
    }
    }

    output{
    file {
    path => "/home/nikb/Desktop/mylogs.log"
    }
    }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.