I'd use epoxy putty. It gets very hard and sticks tenaciously to almost anything. It would be a good idea to dig out the hole a little to make it larger at the bottom so the hard plug of dried epoxy is too big to come out of the hole. If it is IKEA it is probably particle board under veneer and wont offer much strength for the glue to stick, the surface is friable. This is why you should enlarge the hole, to give the glue a better chance of staying in place. Pack the hole with the putty. wait for it to harden overnight. Drill a hole appropriately sized for the fastener and screw it back in gently. Good as its gonna get for fixing IKEA.
So you are (if I get your idea correctly) looking at two large-diameter log sections, large enough that two of them would serve as all the legs needed for your table? Could be a nice look.
If you get lucky, you might find a hollow beech. Pine, less likely in usable form - if it's hollow it's usually also rotten outside that.
Assuming you don't get lucky: Your logs/cylinders have two ends, really - coat them both with something. But the biggest factor is to QUICKLY (or at least before bringing them inside where they will start to dry faster) hollow them out all the way through (not just at one end) so that they can shrink without excessive cracking. A large Forstner drill bit is probably the best method for doing this unless you have access to a large wood lathe, (but if you did, you probably wouldn't be asking this question or contemplating a chainsaw/chisel attempt at it.)
Lay out a circle on the end of the log, and drill overlapping holes to remove the bulk of the wood. Using a large-diameter bit (3 inches or so) will allow you to drill down to where the body of the drill is inside the cavity while still being straight. You will have to drill in stages, and probably from both sides. i.e. take a 18" diameter log, lay out a 14" diameter circle, and drill overlapping 3 inch holes all around the inside of the 14" circle, 3 inches deep; having made 3 inches of depth to work in (so that there is room to get the drill down that far), resume drilling another 3 inches deep, all over, repeat once more, then flip and start from the far side and you can hollow an 18 inch long log.
You can also use any of the (often overly complex) methods that folks dream up for "primitive drums" if you like - I'm simply promoting the quickest way I know, not making use of a large lathe...
If a more finished look worked for you, you could also buy some sonotube (very heavy cardboard concrete form tube) and apply wood veneer to the outside of it.
Best Answer
You can buy adjustable size plastic shims easily at home improvement stores or online. I would fit on to the gap's size and insert gently, using a chisel and hammer.