# Logstash file input plugin no output response

**URL:** <https://discuss.elastic.co/t/logstash-file-input-plugin-no-output-response/191559>\
**Category:** Logstash\
**Created:** [July 22, 2019, 2:17am UTC](https://discuss.elastic.co/t/logstash-file-input-plugin-no-output-response/191559 "2019-07-22T02:17:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dslee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dslee/32/50610_2.png) [@dslee](https://discuss.elastic.co/u/dslee)\
**Post date:** [July 22, 2019, 2:17am UTC](https://discuss.elastic.co/t/logstash-file-input-plugin-no-output-response/191559/1 "2019-07-22T02:17:50Z")

</div>

I am new to ELK so any comment is welcome.

I am now using logstash to parse logs and I want to combine different lines of into one line by using codec =\> multiline plugin. Here is my config.

```auto
input {
  #beats {
  # port => 5044
  #}
  file {
    path => "C:\ELK\log_190712\mq.log"
    start_position => "beginning"
    codec => multiline {
      # grok pattern are valid! :)
      pattern => "^(?<logTimestamp>\d{2} \w{3} \d{4} \d{2}:\d{2}:\d{2},\d{3})"
      negate => true
      what => "previous"
    }
  }
}
filter {
  grok {		
     match => ["message", "(?<logTimestamp>\d{2} \w{3} \d{4} \d{2}:\d{2}:\d{2},\d{3}) %{DATA:logType} %{DATA:ip} \[%{NUMBER:random}\] \[%{DATA:username}\] \[\[%{DATA:threadstate}\] %{DATA:thread}\] %{DATA:logger} %{GREEDYDATA:detail}" ]
  }
  mutate {
    add_tag => ["logstash"]
  }
  date {
    match => ["logTimestamp", "dd MMM yyyy HH:mm:ss,SSS"]
    target => "logTimestamp"
  }  
}
output {
  
  # file {
  # path => "C:\ELK\mq_change.log"
	# codec => line { format => "custom format: %{message}"}
  # #message_format => "%{message}"
  # }
  stdout {
      codec => rubydebug
  }
}

```

I have tested the codec =\> multiline plugin using stdin and it works fine, but when I switch to file plugin, then no responsive even using debug mode. I have tried to delete .sincedb and i also don't work.

The debug message looks like this,

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/c/4c3d8ad08e5d571652213fe07e7d637555015c9e.png)

Please take a look at my case and help me with this problem. Thx.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 22, 2019, 12:16pm UTC](https://discuss.elastic.co/t/logstash-file-input-plugin-no-output-response/191559/2 "2019-07-22T12:16:49Z")

</div>

Firstly, use forward slash instead of backslash in a file input.

Secondly, when you use 'negate =\> true' an event is not pushed until there is a second line that _does_ match the pattern. So you may need to use a timeout, such as 'auto\_flush\_interval =\> 5'.

---

<div class="post-metadata">

**Author:** ![dslee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dslee/32/50610_2.png) [@dslee](https://discuss.elastic.co/u/dslee)\
**Post date:** [July 23, 2019, 6:49am UTC](https://discuss.elastic.co/t/logstash-file-input-plugin-no-output-response/191559/3 "2019-07-23T06:49:37Z")

</div>

Thanks for your comment :).

I have changed that but it didn't work. Finally, by fixing the path and adding timeout mechanism plus adding 'mode = "read"', it finally run as I hope. But I don't know why it works and how it works. Can you explain about it. Thanks.

---

<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:** [August 20, 2019, 6:49am UTC](https://discuss.elastic.co/t/logstash-file-input-plugin-no-output-response/191559/4 "2019-08-20T06:49:41Z")

</div>

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