Actually I am thinking is there any way to find by using codes like 404,500.............
three are different logs I know But code doesn't change I think.
Many log types have a 'level' which is normally one of INFO/WARN/ERROR etc.
Some logs report a status code which indicates the outcome.
If you have installed the appropriate TA for your log type this should be extracted for you You need to identify those fields/tags/values and write a search to identify them.
(sourcetype=iis AND sc_status>=400) OR (sourcetype=myApp AND log_level=error)