object Host "os.google.com" {
import "windows"
address = "linux.google.com"
groups = ["linux"]
}
object Host "mango.google.com" {
import "windows"
address = "mango.google.com"
groups = ["linux"]
assign where "mango" in Hostgroups
}
I want to print the lines above the matched string till the specific pattern in a file
Ex:
I want to print the lines above the assign where "mango" in Hostgroups till this pattern { in the file
Desired output:
object Host "mango.google.com" {
import "windows"
address = "mango.google.com"
groups = ["linux"]
assign where "mango" in Hostgroups