Regex is a real headache for me.
I have this log from one of my server: Aug 23 12:30:01 vm-graylog root: /dev/mapper/cl-root 396G 220G 176G 56% /
I would like to extract the freespace information (176), i have already made a regular expression :
.?\d+.?\d+.?\d+.?\d+.?\d+.?\d+.*?(\d\d+) who “works” but it’s not a good solution because when i have same log like : Aug 23 12:30:01 eyesofnetwork root: /dev/mapper/eyesofnetwork-root 14G 3,8G 9,7G 28% / and i want to extract 9.7 or just 9 my regex doesn’t fonctionning…
I am searching for a long time a solution (by me or by other) but i didn’t find any good solution.
Do you have any tips, advices or solutions for me ?
Sorry for my bad english