Shin splints (a.k.a. medial tibial stress syndrome) are very common in runners. It's an overuse injury. The primary treatment is rest. If you're still training for triathlons, switching to cycling and swimming training only for a few weeks is your best bet for recovery. (Even if you're more focused exclusively on running right now, it would still be a good idea to switch to cross-training exercises like swimming and cycling.)
Once you are recovered, the keys to reducing your risk of recurrence of shin splints are:
- return to running slowly. Do NOT ramp up your mileage too quickly.
- be sure to do a proper dynamic warm up before running, and cool down after with appropriate stretches
- make sure you're wearing good footwear--properly fitted and providing the right kind of support for your feet
If you do all of this, and your shin splints recur, your best bet is to see a medical professional, such as a sports physiotherapist. Someone who can help you to assess your gait, footwear choice, etc. and make knowledgeable suggestions re: any necessary changes. A physio would likely also recommend appropriate rehab exercises.
If you do take a break from running and the pain doesn't go away, and/or it gets worse, it's important to seek help from a medical professional. Shin splints can mostly be treated at home with rest followed by improved training practices. But sharp/worsening pain, or pain that doesn't go away with rest, is a sign of a more serious condition, such as a stress fracture. I strongly encourage you to seek professional medical assistance in such a case.
Best wishes for getting this under control. Training injuries suck.