簡體   English   中英

Logstash:拆分輸出

[英]Logstash: splitted output

是否可以在Logstash配置中拆分輸出? 例如:我有輸入:日志:file1.log和file2.log想要的輸出:

  1. redis-易於使用文檔進行配置

  2. 僅適用於file1.log內容的%MyBigStorage%\\ archive \\ file1.log

  3. %MyBigStorage%\\ archive \\ file2.log僅用於file2.log內容

還有1件事:是否可以為文件夾配置它?

是的,您可以拆分輸出。 另外,您可以按文件夾拆分輸出。

首先,當您輸入日志時,可以定義每個輸入的類型。

input {
    file {
        path => "/path/to/first/folder/*"  # The * is tell logstash input all the log file in this directory
        type => "file1.log"
    }
    file {
        path => "/path/to/second/folder/*"  
        type => "file2.log"
    }
}

output {
    if [type] == "file1.log" {
         # output to XXX
    } else if [type] == "file2.log" {
         # output to YYY
    }
}

希望這可以幫到你。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM