How do are check existing fields, if doesnt exists add field

I'm indexing cisco logs, were some fileds dont exists in other events. please help.

It's very hard to understand what you're asking. Please clarify. Examples of what you want to do often helps.