logstash не читает входной файл после попытки всех опций - PullRequest
0 голосов
/ 30 апреля 2019

Logstash не принимает файл ввода, я перепробовал все доступные варианты и ответы на другие вопросы.Прикрепление файла conf и логов.

Пытался:

start_position => beginning 
 sincedb_path => "D:\ELK\d.d1"
 ignore_older => 0

ФАЙЛ КОНФ:

input {
   file {
      path => "D:\ELK\inlog.log"
      start_position => beginning 
      sincedb_path => "D:\ELK\d.d1"
      ignore_older => 0
   }enter code here
}
output {
   file {
      path => "D:\ELK\outlog.log"
   }
}

ЛОГИ:

Sending Logstash logs to D:/ELK/logstash-6.5.4/logstash-6.5.4/logs which is now configured via log4j2.properties
[2019-04-30T18:21:21,370][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-04-30T18:21:21,401][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"6.5.4"}
[2019-04-30T18:21:24,666][INFO ][logstash.pipeline        ] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50}
[2019-04-30T18:21:25,104][INFO ][logstash.pipeline        ] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x6f6c3c0b run>"}
[2019-04-30T18:21:25,151][INFO ][logstash.agent           ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2019-04-30T18:21:25,166][INFO ][filewatch.observingtail  ] START, creating Discoverer, Watch with file and sincedb collections
[2019-04-30T18:21:25,470][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600}

ФАЙЛ ВВОДА:

this is testing of me 
this is testing of me

выходной файл не генерируется.Пожалуйста, помогите

1 Ответ

0 голосов
/ 09 мая 2019

Для файлов, я думаю, вы можете использовать биение файла для мониторинга и чтения из файлов, а затем отправлять вывод в logstash.Вот пример конфигурации filebeat yml.

filebeat.prospectors:
- type: log
  _type: applogs
  tags: ['applogs']
  multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
  multiline.negate: true
  multiline.match: after
  multiline.max_lines: 100
  scan.order: desc
  scan.sort: modtime
  scan_frequency: 10s
  backoff: 10s
  close_inactive: 10m
  #clean_inactive removes the state of a file after the specified period of inactivity has elapsed. 
  #clean_inactive setting must be greater than ignore_older + scan_frequency
  #ignore_older: 72h
  #clean_inactive: 80h
  paths:
  - C:\logs\logserver\production\app\*\*.txt
  - C:\logs\logserver\production\app\AlertMessage\debug_XXX*.txt
- type: log
  _type: IIS
  tags: ['IIS']
  scan.order: desc
  scan.sort: modtime
  scan_frequency: 10s
  close_inactive: 10m
  #Enable for Production
  #ignore_older: 72h
  clean_inactive: 80h
  paths: 
    - C:\logs\IISLogs\W3SVC1\*.log

#----------------------------- Logstash output --------------------------------
output.logstash:
  # Boolean flag to enable or disable the output module.
  enabled: true
  hosts: ["127.0.0.1:5044"]
  # Number of workers per Logstash host.
  worker: 2
...