0

I am very new to logstash and trying to work with Logstash. As of now i simply want to read a log file and put it under a different file. But output file is not getting generated. Below is the configuration i am using in logstash.conf file:

# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.

input {
   file {
      path => "C:\test.log"
      start_position => "beginning"
   }
}
output {
   file {
      path => "C:\temp\outlog.log"
   }
}

Can anyone please help me out as what i am missing here. This is a simple example i want to execute from a tutorial.

pradyumn
  • 130
  • 13
  • When trying a new logstash configuration, it useful to add an stdout output, which will show if any event are treated by logstash. What's the output of the logstash command? Also logstash remembers what it has already read, so if you have already launched logstash with the same configuration without adding anything to the log file, logstash won't read anything new: see [How to force Logstash to reparse a file?](https://stackoverflow.com/questions/19546900/how-to-force-logstash-to-reparse-a-file) – baudsp Jan 24 '19 at 16:20
  • stdin and stdout are working fine are result is shown on cmd prompt – pradyumn Jan 24 '19 at 17:16

1 Answers1

2

Try to change your path from backslash to forward slash and see if it works.

input {
   file {
      path => "C:/test.log"
      start_position => "beginning"
   }
}
output {
   file {
      path => "C:/temp/outlog.log"
   }
}
leandrojmp
  • 7,082
  • 2
  • 19
  • 24
  • Thank you. It did work with forward slash. But what if the file is some shared folder in the network in other server/machine. – pradyumn Jan 24 '19 at 20:25
  • Never tried that, but I think that you just need to set the path as `path => "//host/share/file.log"` – leandrojmp Jan 25 '19 at 01:12