I have a bash script
counter=0
for file in /home/ec2-user/Workspace/events_parts/*
do
counter=$[counter + 1]
event=$(cat $file | jq '.Event')
echo $event
if [ "$event" = "Time Exceeded" ] || [ "$event" = "Load Time" ]; then
echo "Coming Here"
jq ".url = \"$(jq '.Message' $file | sed 's/.*proxy=\([^&]*\).*/\1/')\"" $file
else
jq ".url = null"
fi
done
~
In the bash script above I am trying to extract Event field from a JSON file and check for two possible values.if [ "$event" = "Time Exceeded" ] || [ "$event" = "Load Time" ]; is not workign as I would expect. I have verified that the values that I am comparing against are indeed there.