With freestyle jobs if you add to post build action to publish data to influxdb it always uses the first target from the dropdown list. Doesn't matter how you save the job configuration it always revert back to first option.
To reproduce:
Define 2 targets (databses) in Global Configuration
Create freestyle job
Add publish to influxdb post build action and use second target from the list
Save
Open job configure again
See the first option in use
Choose second option
Save
Run the job
See from job console output that it sends the data to first target