There is no way to get a configuration file to reference another configuration file, at least not in the way you describe.
However, Splunk has a way to store "state information" like a hostname. There are two variations.
First, you could write the information to a csv file stored in the lookups subdirectory, and set up the csv file as a lookup.
Or, you could write the information (as a collection) to the KV store and set up a lookup based on the collection.