Q:

I got a stomach flu or I got the stomach flu or I got stomach flu?

When I googled stomach flu, there were many questions and statements like 

How do you get the stomach flu? 

Or

Difference between a stomach flu and food poisoning 

Or 

Six facts about stomach flu

When do you use the, a or nothing? And which should I use for a sentence like "I got a stomach flu from someone" ?

A:

Firstly, 'Stomach flu' is not an official medical term - 'Stomach flu' is probably referring to something like gastroenteritis.
The poster asking 'How do you get the stomach flu' is probably saying it that way because that is how you refer to the flu, which is a contraction of 'Influenza'. It's common to refer to other illnesses this way, but colloquially (not officially), such as 'The Bends' (pressure sickness) or 'The Clap' (venereal disease). 
Technically, there are many different strains of flu, such as H1N1, H1N2 etc. So if you don't know the type, you can refer to it non-specifically as 'a type of flu' or 'a flu'. Whereas if you specify that it is stomach flu, you don't need to prefix it with 'the' or 'a', because you have said what type it is. Examples of how it might be phrased:

I've got the flu.
I've got stomach flu.
I feel unwell. It might be stomach flu.
I've caught the flu from someone.
I've caught stomach flu from someone.
I've got gastroenteritis - it's like a stomach flu.

Hope this helps!

A:

Short answer:  "The flu" is probably the one you want.
Long answer:
When your affliction is a specific named one, you often omit the article altogether.  All of these would be acceptable:

I have rickets.  I have measles.  I have AIDS.  I have cystic fibrosis. I have Zika.  I have canine distemper.*

Rough day for me.
When you are referring to symptoms of a disease, you sometimes use the indefinite article, "a."

I have a cough.  I have a rash.  I have a cyst.  I have a headache.  I have a fever.

....and sometimes use no article:

I have nauseau.  I have diarrhea.  I have dizziness. 

A cold is a collection of symptoms, and usually takes the indefinite article.

I have a cold.

But if you know exactly which type of cold you have, you might switch to the definite article:

I have the common cold.

Flu is somewhat like cold in this respect.  In the past, all flus were thought to be the same malady.  Now we differentiate between avian flu, swine flu, Spanish flu and others.  (See ngrams )  If you just want to say that you have some type of flu-like illness, you might say _"a flu." If you are referring to the same flu that everyone else seems to be getting this year, you probably want to say "the flu."   If you aren't sure, use "the."

A:

Since stomach flu is an informal term anyway (not medically specific or used in a setting where you might say gastroenteritis or something like that), you can use either the definite or the indefinite article and people will understand just what you mean.  
The subtlety is that when you use "the" you are implying that there is one particular virus*  circulating, and your audience probably knows others who have gotten sick with the same symptoms, so your use of "the" intends to tap into the listener's knowledge of what (they or) others have experienced recently.
By contrast, "a" implies that you have acquired some virus* which affects your stomach but there are multiple such illnesses out there and you are not being specific about exactly which one you have.  
In "Six facts about stomach flu" there is no article because "stomach flu" is being discussed as a general concept.  When you have a/the stomach flu, you have one specific illness, and the difference between definite and indefinite article is the implication about how many such illnesses are out there within the relevant range of consideration.  The article title ("six facts about...") does not imply that the author is sick at all or that the advice contained in that article is limited to any specific strain of virus*.  
The bold words in the last paragraph can be read as more general guidance for when trying to decide between definite articles ("the") and indefinite articles ("a/an").

*: (or bacteria or other cause of disease).

