My application wants to sent dat to SPLUNK via Monitor files and directories and meantime via HTTP Event Collector. My application will format the data them required. Can I use the same data source type to sent to data with different format via different method(Monitor files and directories and meantime via HTTP Event Collector).
Yes, thats totally fine if the data formatting is identical from both sources.
It would make very little sense (and probably cause you issues down the line) if you have two differing formats of the same sourcetype, but it sounds like you can control the format of the data to ensure its consistent.