Thanks syg00 for the insights.
I tried with the suggestion given but couldnt get the results.
Code:
ssh username@hostname grep -s '(?<=\().*(?=\))' /home/folder1/file.log
bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `grep -s (?<=\().*(?=\)) /home/username/file1.log'
So a little more background of this issue is
I am trying in getting a warning notifications if the exact match is found along with the package name defined inside the parenthesis. [In the log file the same error text appears but for different packages one example as -->((OpenJawFlightPriceCheckProvider.lambda$checkPrice$0) which we don't want to consider ]
With that said removed all the other sentences and added the option "s" in the below code
Code:
ssh username@${hostname[i]} grep -s 'ERROR Cruise is not available due to error while checking cruise price' /home/folder1/file.log | wc -l
The above resulted in getting the output as 1 which is correct , but if we change the package name (inside the parenthesis) the grep gets the same count. This is the issue which am trying to resolve.