Reading from a file and immediately writing to another file

I'm trying to configure logstash to read data from one file, and write to another file.
This simple task is for a test.

It's simple (C:\Bitnami\elk\logstash\conf\test1.conf):

input {
  file {
    path => "C:\Upload\DNS_log_03.log"
    sincedb_path => "C:\Upload\null"
    start_position => "beginning"
    file_completed_action => "log"
    file_completed_log_path => "C:\Upload\log.log"
  }
}
 
output {
  file {
    path => "C:\Upload\outfile.log"
    codec => "json"
  }
}

But that does not work.
The file "C: \ Upload \ log.log" is created, zero length.
The file "C: \ Upload \ null" is created, zero length.

Log in debug mode does not write anything intelligible.

And that is all.

The file "C:\Upload\outfile.log" is not created.

What am I doing wrong?

Do not use backslash in the path option of a file input, use forward slash.

This does not work...

C:\Bitnami\elk\logstash\conf\test1.conf
input {
file {
path => "C:\Upload\DNS_log_03.log"
sincedb_path => "C:\Upload\null"
start_position => "beginning"
file_completed_action => "log"
file_completed_log_path => "C:\Upload\log.log"
}
}

output {
file {
path => "C:/Upload/outfile.log"
#codec => "json"
}
}

logstash-plain.log
...
[2019-11-18T09:06:58,418][DEBUG][logstash.outputs.file ] config LogStash::Outputs::File/@path = "C:/Upload/outfile.log"
...
[2019-11-18T09:06:59,105][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2019-11-18T09:06:58,590][DEBUG][org.logstash.config.ir.CompiledPipeline][main] Compiled output
P[output-file{"path"=>"C:/Upload/outfile.log"}|[str]pipeline:12:3:```
file {
path => "C:/Upload/outfile.log"
#codec => "json"
}

 into
 org.logstash.config.ir.compiler.ComputeStepSyntaxElement@c96a6eaa
[2019-11-18T09:06:58,590][DEBUG][org.logstash.config.ir.CompiledPipeline][main] Compiled output
 P[output-file{"path"=>"C:/Upload/outfile.log"}|[str]pipeline:12:3:```
file {
    path => "C:/Upload/outfile.log"
    #codec => "json"
  }
```]
 into
 org.logstash.config.ir.compiler.ComputeStepSyntaxElement@c96a6eaa
[2019-11-18T09:06:58,605][DEBUG][org.logstash.config.ir.CompiledPipeline][main] Compiled output
 P[output-file{"path"=>"C:/Upload/outfile.log"}|[str]pipeline:12:3:```
file {
    path => "C:/Upload/outfile.log"
    #codec => "json"
  }
```]
 into
 org.logstash.config.ir.compiler.ComputeStepSyntaxElement@c96a6eaa
[2019-11-18T09:06:58,605][DEBUG][org.logstash.config.ir.CompiledPipeline][main] Compiled output
 P[output-file{"path"=>"C:/Upload/outfile.log"}|[str]pipeline:12:3:```
file {
    path => "C:/Upload/outfile.log"
    #codec => "json"
  }
```]
 into
 org.logstash.config.ir.compiler.ComputeStepSyntaxElement@c96a6eaa
[2019-11-18T09:07:00,465][DEBUG][logstash.outputs.file    ] Starting flush cycle
...

And, the file C:\Upload\outfile.log is also not created.

Any more ideas?

Work:

input {
file {
path => "C:/Upload/DNS_log_03.log"
sincedb_path => "C:/Upload/null"
start_position => "beginning"
file_completed_action => "log"
file_completed_log_path => "C:/Upload/log.log"
}
}

output {
file {
path => "C:/Upload/outfile.log"
#codec => "json"
}
}

thanks )

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