How would I design a circuit that converts a line level signal to be able to be fed into a microphone input? The input impedance of the microphone jack is 2 kohms.
What you need to do is reduce the voltage level, and block any DC.
The resistors are set up as voltage dividers which reduce the input level to something managable by the microphone input. The capacitors block the DC.
How much should you attenuate the signal? It depends on the typical line levels you'll get from your equipment. According to one test, typical microphone voltage levels are in the region of a couple of 10s of millivolts. Line levels are probably in the region of a volt. So you'll need something like a 100:1 reduction in signal level. Of course, the input impedance will also act as part of the resistor divider.
To play it safe, you could simply use a couple of pots so that you can start off with a strong attenuation, and slowly lessen it until the levels are nice.
Drop your inputs with a resistive net (10K-ish) and a DC block, maybe a 104 cap, then once the signals are down, mix it all back out with an op amp like a TL072 with whatever -gain you want out of it, or you can use the opamp as a buffer if the attenuation is ok. The point is that the opamp will give you a really high impedance and a really low output impedance, that's good. Mixing is best done at low volume levels anyway. The mic input may be 2K or whatever it is, but it's not that important since it's a voltage device and not a current device.
That's what a DI (aka direct box) does. You can use a DI to take a line level keyboard or mixer output and bring it down to mic level to plug into a mic preamp for example.
DI's often have a switchable pad so they can accept line level sources (with the pad on) as well as lower level signals from a guitar/bass etc with the pad off. Something like 12-20dB is usually plenty for the pad.
All you need is a step down transformer and a resistive pad. Usually DIs use a 12:1 transformer or so.
Something like this could work:
Image from: https://sound-au.com/p35-f2.gif
You might not need that RC circuit at pin 1 of the XLR. I usually leave that out for stuff like this.
Your main goal is to bring the signal level down to something the preamp can work with. Impedance matching is not so important here. A line level source will likely have pretty low impedance which is fine for this situation. You would only run into trouble if its impedance were too high, more than about 150Ω, but that's unlikely.
Hope this helps!