我想只寫入一個文件大小寫行,所有實例在nvp_add函數中以符號$
開頭,後面的語句從下面的輸入文件擴展屬性,所以我期待在我的文本輸出文件中輸出如下所示。
case "11": ### eventDDoSLow
$severity
$description
$eventID
$eventURL
$alertLevel
$eventStart
$eventSourceCount
$eventSourceTable
$eventDestCount
$eventDestTable
$eventProtocolCount
$eventProtocolTable
輸入文件如下:
case "11": ### eventDDoSLow
include "$NC_RULES_HOME/include-snmptrap/riverbed/riverbed-
MAZU-MIB.parser.include.snmptrap.rules"
@URL = $eventURL
$OS_EventId = "SNMPTRAP-riverbed-MAZU-MIB-eventDDoSLow"
@AlertGroup = "Denial Of Service"
@AlertKey = "Event ID: " + $eventID
@Summary = "Denial of Service (Src: " + $mazuSourceName + ", Dest: " +
$mazuDestName + ")" + " (" + @AlertKey + ") "
$DEFAULT_Severity = 2
$DEFAULT_Type = 1
$DEFAULT_ExpireTime = 0
@Identifier = @Node + " " + @AlertKey + " " + @AlertGroup + " " +
$DEFAULT_Type + " " + @Agent + " " + @Manager + " " + $specific-trap
$alertLevel = $alertLevel + " (" + $5 + ")"
if(match($OPTION_EnableDetails, "1") or
match($OPTION_EnableDetails_riverbed, "1")) {
details($severity, $description, $eventID, $eventURL, $alertLevel,
$eventStart, $eventSourceCount, $eventSourceTable, $eventDestCount, $eventDestTable,
$eventProtocolCount, $eventProtocolTable)
}
@ExtendedAttr = nvp_add(@ExtendedAttr, "severity", $severity,
"description", $description, "eventID", $eventID,
"eventURL", $eventURL, "alertLevel", $alertLevel,
"eventStart", $eventStart,
"eventSourceCount", $eventSourceCount, "eventSourceTable",
$eventSourceTable, "eventDestCount", $eventDestCount,
"eventDestTable", $eventDestTable)
case語句在我輸入的文本文件,我只是想提取的情況下發言,並所有字符串與$從nvp_add功能從我的文本輸入文件開始寫這些成我的輸出文件。 – user2671444