cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

UserAgentEntry added to JDBC URL but not visible in Audit logs

Databricks24
New Contributor

Hi,

As part of Databricks Best Practices, I have added 'UserAgentEntry' to JDBC URL that is being created when we are executing SQL statements through the JDBC driver.

Sample url - jdbc:databricks://<host>:443;httpPath=<httpPath>; AuthMech=3;UID=token;PWD=<token>;UserAgentEntry=<ApplicationName/Year>;

We have also enabled 'DatabricksSQL' category logs from the Diagnostic logging to check for the same. No User Agent value is being set.

Kindly help to resolve the issue.

Thanks

2 REPLIES 2

Kaniz_Fatma
Community Manager
Community Manager

Hi @Databricks24, Certainly! Itโ€™s great that youโ€™re following best practices in Databricks.

 

Letโ€™s address the issue with the UserAgentEntry in the JDBC URL.

 

UserAgentEntry in JDBC URL:

  • The UserAgentEntry parameter in the JDBC URL allows you to specify a custom user agent string for your Databricks JDBC connections. This can be useful for tracking or identifying specific applications or clients.
  • Youโ€™ve included UserAgentEntry=<ApplicationName/Year> in your sample URL. Replace <ApplicationName/Year> with an appropriate value representing your application or use case. For example, you could set it to something like MyApp/2023.
  • Make sure to choose a descriptive and unique value for your application to differentiate it from other clients connecting to Databricks.

Diagnostic Logging and User Agent Value:

  • You mentioned enabling the โ€˜DatabricksSQLโ€™ category logs for diagnostic purposes. However, you do not see the user agent value being set.
  • Letโ€™s troubleshoot this:
    • Ensure that the JDBC URL in your application code includes the UserAgentEntry parameter, as shown in your sample URL.
    • Verify that the application code correctly constructs the JDBC URL with the appropriate values for host, httpPath, token, and other parameters.
    • Check if any additional configurations or settings in your application might override or ignore the user agent value.
    • If youโ€™re using connection pooling or connection management libraries, ensure they do not interfere with the user agent setting.
    • Review any logs or error messages related to JDBC connections to identify issues.
    • If necessary, consult the Databricks documentation or seek assistance from Databricks support to troubleshoot further.

Remember to replace placeholders like <host>, <httpPath>, <token>, and <ApplicationName/Year> with actual values specific to your environment and use case.

 

If you encounter any specific errors or issues, please provide additional details; Iโ€™ll be happy to assist further! ๐Ÿ˜Š

Kaniz_Fatma
Community Manager
Community Manager

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 
 

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!