I think its probably a hernia you're witnessing. Did you do any heavy work/exercise in the recent past ? Many a times that triggers the hernia site. You should definitely get it checked. Hernia are rarely life threatning but they cause excruciating pain. The cure would be a minor surgery where they insert a mesh to fix it up. It could also be pus but I doubt it as you said the pain comes in episodes so its likely to be hernia.