-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1179 from splunk/fix-cp-hostname
fix: Correct ordering of host selection
- Loading branch information
Showing
3 changed files
with
111 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,31 +54,61 @@ block parser checkpoint_syslog-parser() { | |
}; | ||
|
||
|
||
if { | ||
# If hostname field is not empty, host should be evaluated from there | ||
filter { | ||
match('(\S+)' value("[email protected]") flags(store-matches)); | ||
}; | ||
rewrite { | ||
set("$1", value("HOST")); | ||
}; | ||
} elif { | ||
#Get the FW host from the originsicname | ||
filter { | ||
match('^[Cc][Nn]\\?=([^,]+)' value("[email protected]") flags(store-matches)); | ||
}; | ||
rewrite { | ||
set("$1", value("HOST")); | ||
}; | ||
} elif { | ||
#Get the FW host from the origin_sic_name | ||
filter { | ||
match('^[Cc][Nn]\\?=([^,]+)' value("[email protected]_sic_name") flags(store-matches)); | ||
if ( | ||
"`SC4S_LISTEN_CHECKPOINT_SPLUNK_OLD_HOST_RULES`" eq "yes") | ||
{ | ||
if { | ||
#Get the FW host from the originsicname | ||
filter { | ||
match('^[Cc][Nn]\\?=([^,]+)' value("[email protected]") flags(store-matches)); | ||
}; | ||
rewrite { | ||
set("$1", value("HOST")); | ||
}; | ||
} elif { | ||
#Get the FW host from the origin_sic_name | ||
filter { | ||
match('^[Cc][Nn]\\?=([^,]+)' value("[email protected]_sic_name") flags(store-matches)); | ||
}; | ||
rewrite { | ||
set("$1", value("HOST")); | ||
}; | ||
} elif { | ||
# If hostname field is not empty, host should be evaluated from there | ||
filter { | ||
match('(\S+)' value("[email protected]") flags(store-matches)); | ||
}; | ||
rewrite { | ||
set("$1", value("HOST")); | ||
}; | ||
}; | ||
rewrite { | ||
set("$1", value("HOST")); | ||
} else { | ||
if { | ||
# If hostname field is not empty, host should be evaluated from there | ||
filter { | ||
match('(\S+)' value("[email protected]") flags(store-matches)); | ||
}; | ||
rewrite { | ||
set("$1", value("HOST")); | ||
}; | ||
} elif { | ||
#Get the FW host from the originsicname | ||
filter { | ||
match('^[Cc][Nn]\\?=([^,]+)' value("[email protected]") flags(store-matches)); | ||
}; | ||
rewrite { | ||
set("$1", value("HOST")); | ||
}; | ||
} elif { | ||
#Get the FW host from the origin_sic_name | ||
filter { | ||
match('^[Cc][Nn]\\?=([^,]+)' value("[email protected]_sic_name") flags(store-matches)); | ||
}; | ||
rewrite { | ||
set("$1", value("HOST")); | ||
}; | ||
}; | ||
}; | ||
}; | ||
# If this device is a v host we need to get the firewall name | ||
if { | ||
filter { | ||
|