The mucus plug is a mass of thick, transparent, sticky, greenish or light brown mucus, sometimes covered with bloody streaks if the cervix is weakened.
It serves to keep the cervix closed during pregnancy to protect the fetus from infections.
Approaching childbirth, the cervix changes and starts to open, resulting in the loss of the mucus plug.
However the loss of the mucus plug is not a sufficiently reliable sign of imminent childbirth and you do not need to consult a physician.