Need help in formatting register variable

I have used the below play to display the files and folders with some pattern

- name: Display backup files
  shell: "du -h {{partition}} --time | sort -rh | grep -o -P '(.*bk|.*bkup|.*bak|.*backup|.*logs' | sort -rh | awk -F'\t' '{print $3}'|uniq|head -n 100"
  register: status

and while using this command i am getting output as below which i have stored in register variable called status

7.4G 2018-12-24 03:46 /logs/backups
6.4G 2018-12-24 03:46 /logs/backups/config_bkp_11dec
7.4G 2018-12-24 03:46 /logs/backups/config_bkp_18nov

The thing is i need to eliminate the entire child path lines amd need to hold the parent path /logs/backups... is there anyway to do that...

Hi

Not sure what "eliminate the entire child path lines" means - is that
some local jargon?
Giving actual preferred output would avoid us doing any guestimations
and/or (mis)interpretations of said jargon.

Either way, yes you're using ansible, but just it's 'shell' module as
a conveyor mechanism to execute a lot of piped shell commands.
I would suggest adding a few extra.
If any, this would avoid you dividing the text processing between the
shell and ansible.

Dick

Hi

Not sure what "eliminate the entire child path lines" means - is that
some local jargon?
Giving actual preferred output would avoid us doing any guestimations
and/or (mis)interpretations of said jargon.

Either way, yes you're using ansible, but just it's 'shell' module as
a conveyor mechanism to execute a lot of piped shell commands.
I would suggest adding a few extra.
If any, this would avoid you dividing the text processing between the
shell and ansible.

Dick

I agree, this is not related to Ansible proper. And I'm also sure that this shell command is way too complicated.

Regards
         Racke