Error connecting agent to Oracle Database using SQL input integration

I'm trying to use the sql input integration to query a database, but keep getting the following error:

cannot open connection: testing connection: dpoPool_create user=METRICBEAT extAuth=0: ORA-12154: TNS:could not resolve the connect identifier specified

I've tried all the different patterns of connection strings:

'user="user" password="password" connectString="dns:1521/XXX.localdomain"'

'user="user" password="password" connectString="dns:1521/XXX"'

'user="user" password="password" connectString="ip:1521/XXX.localdomain"'

'user="user" password="password" connectString="ip:1521/XXX"'

"user/password@ip:1521/XXX.localdomain"

"user/password@ip:1521/XXX"

'user="user" password="password" connectString="dns:1521/XXX" sysdba=true'

'user="user" password="password" connectString="ip:1521/XXX" sysdba=true'

But keep getting the same results. Any ideas?