# File input doesn t read incoming Json file from web application but when modified everythnig is fine

**URL:** <https://discuss.elastic.co/t/file-input-doesn-t-read-incoming-json-file-from-web-application-but-when-modified-everythnig-is-fine/277284>\
**Category:** Logstash\
**Created:** [June 29, 2021, 4:56am UTC](https://discuss.elastic.co/t/file-input-doesn-t-read-incoming-json-file-from-web-application-but-when-modified-everythnig-is-fine/277284 "2021-06-29T04:56:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hadii](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hadii/32/82523_2.png) [@hadii](https://discuss.elastic.co/u/hadii)\
**Post date:** [June 29, 2021, 4:56am UTC](https://discuss.elastic.co/t/file-input-doesn-t-read-incoming-json-file-from-web-application-but-when-modified-everythnig-is-fine/277284/1 "2021-06-29T04:56:27Z")

</div>

I have to project in rails which have huge logs, I want to parse them in logstash and kibana, the problem is when logs do from web application logstash could not pars them but after modified them even very unused change then logstash pars them. I'm looking in logstash logs but everything is fine, I also found this issues which are completely mine but our config file is different I don't know what's wrongs could you please help me.

```auto
input {
    file {
        start_position => "beginning"
        type => "json"
        path => ["/usr/share/logstash/MPD_LOCATION/*",
                 "/usr/share/logstash/MPD_LOCATION/*/*",
                 "/usr/share/logstash/MPD_LOCATION/*/*/*",
                 "/usr/share/logstash/MPD_LOCATION/*/*/*/*",
                 "/usr/share/logstash/MPD_LOCATION/*/*/*/*/*"]
# sincedb_path => "/dev/null"
  }
}

filter {
    mutate {
        gsub => ["message","/}+({)/", "}::{"]
    }
    mutate {
        gsub => ["message","/}+( )/", "}::"]
    }
    split {
        field => "message"
        terminator => "::"
    }
    json { source => "message" }
    mutate {
        add_field => { "uuid" => "D%{driver_id}T%{created_at}" }
        rename => {
                "[location][latitude]" => "[location][lat]"
                "[location][longitude]" => "[location][lon]"
        }
        convert => {
                "[location][lat]" => "float"
                "[location][lon]" => "float"
        }
    }
}
output {
    if ([type] == "location") {
      elasticsearch {
        hosts => "http://elasticsearch:9200"
        index => "live_locations_%{+YYYY_MM_dd}"
        manage_template => true
        template => "/usr/share/logstash/Template/live_locations.json"
        template_name => "live_locations"
        document_id => "%{uuid}"
      }
    } else if ([type] == "app_info") {
      elasticsearch {
        hosts => "http://elasticsearch:9200"
        index => "app_info_%{+YYYY_MM_dd}"
        document_id => "%{uuid}"
      }
    }
    stdout {}
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 27, 2021, 4:56am UTC](https://discuss.elastic.co/t/file-input-doesn-t-read-incoming-json-file-from-web-application-but-when-modified-everythnig-is-fine/277284/2 "2021-07-27T04:56:45Z")

</div>

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