Guys i have one file and i want the o/p from that file like below
This is my sample file and i want three things from it.
Name:
State just below the Name: dont want the state under the Retention Level:
And retention Level
Name: MEANS_SLP_DAILY
State: inactive
Retention Level: 3 (1 month)
State: active
Retention Level: 3 (1 month)
State: active
Retention Level: 3 (1 month)
State: active
Name: MEANS_SLP_WEEKLY
State: inactive
Retention Level: 3 (1 month)
State: active
Retention Level: 3 (1 month)
State: active
Retention Level: 3 (1 month)
State: active
Name: SLP_Irv_Arlington_Test
State: active
Retention Level: 1 (2 weeks)
State: active
Retention Level: 1 (2 weeks)
State: active
Retention Level: 1 (2 weeks)
State: active
I have tried this code for the above file but here i am not getting retention level. I also want to grep retention level too. Please suggest
cat /tmp/1 | grep 'Name' -A1
Name: MEANS_SLP_DAILY
State: inactive
--
Name: MEANS_SLP_WEEKLY
State: inactive
--
Name: SLP_Irv_Arlington_Test
State: active
I want my final o/p look like below
Name: MEANS_SLP_DAILY State: inactive Retention Level: 3 (1 month) Retention Level: 3 (1 month) Retention Level: 3 (1 month)
Name: MEANS_SLP_Weekly State: inactive Retention Level: 3 (1 month) Retention Level: 3 (1 month) Retention Level: 3 (1 month)