When i run any notebook I want to log by using which cluster the notebook was executed.
Is their any way to get the cluster name using python in databricks
When i run any notebook I want to log by using which cluster the notebook was executed.
Is their any way to get the cluster name using python in databricks
Hello @abhishek6555,
Thanks for the ask and using Microsoft Q&A platform.
Is their any way to get the cluster name using python in databricks?
You can use the below command to get the cluster name using python in databricks:
cluster_name = spark.conf.get("spark.databricks.clusterUsageTags.clusterName")
print(cluster_name)

Hope this helps. Do let us know if you any further queries.
Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.
4 people are following this question.