diff --git a/splunk/src/main/java/org/apache/calcite/adapter/splunk/search/SplunkConnectionImpl.java b/splunk/src/main/java/org/apache/calcite/adapter/splunk/search/SplunkConnectionImpl.java
index 9664e928b10..e973898ae3b 100644
--- a/splunk/src/main/java/org/apache/calcite/adapter/splunk/search/SplunkConnectionImpl.java
+++ b/splunk/src/main/java/org/apache/calcite/adapter/splunk/search/SplunkConnectionImpl.java
@@ -58,7 +58,7 @@ public class SplunkConnectionImpl implements SplunkConnection {
private static final Pattern SESSION_KEY =
Pattern.compile(
- "\\s*([0-9a-f]+)\\s*");
+ "([0-9a-zA-Z^_]+)");
final URL url;
final String username;