You can try the -o grep option, return only the matching portion.
Of course, grep -o -m1 "OS=MX"
will not match enough - the desired following characters must be specified.
It seems to end with a dot, so use an RE "all not-dot characters" grep -o -m1 "OS=MX[^.]*"
It's always good to add a boundary, so it wouldn't match e.g. a BOS=MXxx
On the right side there is the dot boundary, on the left side we put a boundary marker (that does not match a character ). grep -o -m1 "\bOS=MX[^.]*"
If you do not want the tailing slash then the tricky solution is grep -o -m1 "\bOS=MX[^.]*[^/.]"
A boundary followed by OS=MX followed by any amount of not-dot characters followed by a neither-slash-nor-dot character.
@ernesto022483
please start using markdown code tags when posting code/data samples - the markdown usage is outlined here on the community welcome page.
I've edit your OP for now.