Both are correct, with only a subtle difference in nuance. As usual, a is vague and unspecified, while the indicates more certainty.
I have a feeling we are going to be late (= I'm not sure but I think this will happen)
I have the feeling we are going to be late (= I'm not sure but I'm fairly certain this will happen)
Since things like degree of anxiety and uncertainty vary from person to person, there's no way to say exactly what these mean in every situation. You have to judge from the context, and what you know about the speaker.
This is the same for most similar nouns: idea, belief, thought, sense, intention, etc.
Related note: Both a and the don't work with feeling in every context. For example:
(✔) I have a bad feeling about this.
(✖) I have the bad feeling about this.
If you want to use the, then you have to be specific:
I have the bad feeling (that) Kate is angry with me.