Skip to content

Commit 8cb020b

Browse files
authored
Merge pull request #345 from splunk/timestamp-parsing
Update README.md
2 parents bc0ccc1 + 9e5e331 commit 8cb020b

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ Use the below schema to configure Splunk Connect for Kafka
135135
"splunk.hec.ssl.trust.store.password": "<Java KeyStore password>"
136136
"kerberos.user.principal": "<The Kerberos user principal the connector may use to authenticate with Kerberos>",
137137
"kerberos.keytab.path": "<The path to the keytab file to use for authentication with Kerberos>"
138+
"enable.timestamp.extraction": "<true|false>",
139+
"timestamp.regex": "<regex for timestamp extraction>",
140+
"timestamp.format": "<time-format for timestamp extraction>"
138141
}
139142
}
140143
```
@@ -222,6 +225,13 @@ Use the below schema to configure Splunk Connect for Kafka
222225
| `key.converter.schema.registry.url` | Schema Registry URL. | `""` |
223226
| `key.converter.schemas.enable` | For using protobuf format ,set the value of this field to `true` | `false` |
224227

228+
### Timestamp extraction Parameters
229+
| Name | Description | Default Value |
230+
|-------- |----------------------------|-----------------------|
231+
| `enable.timestamp.extraction` | To enable timestamp extraction ,set the value of this field to `true`. <br/> **NOTE:** <br/> Applicable only if `splunk.hec.raw` is `false` | `false` |
232+
| `timestamp.regex` | Regex for timestamp extraction. <br/> **NOTE:** <br/> Regex must have name captured group `"time"` For eg.: `\\\"time\\\":\\s*\\\"(?<time>.*?)\"` | `""` |
233+
| `timestamp.format` | Time-format for timestamp extraction .<br/>For eg.: <br/>If timestamp is `1555209605000` , set `timestamp.format` to `"epoch"` format .<br/> If timestamp is `Jun 13 2010 23:11:52.454 UTC` , set `timestamp.format` to `"MMM dd yyyy HH:mm:ss.SSS zzz"` | `""` |
234+
225235
## Load balancing
226236

227237
See [Splunk Docs](https://docs.splunk.com/Documentation/KafkaConnect/latest/User/LoadBalancing) for considerations when using load balancing in your deployment.

src/main/java/com/splunk/kafka/connect/SplunkSinkConnectorConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public final class SplunkSinkConnectorConfig extends AbstractConfig {
9191

9292
// Input the Regex String and timestamp format
9393
static final String ENABLE_TIMESTAMP_EXTRACTION_CONF = "enable.timestamp.extraction";
94-
static final String REGEX_CONF = "regex";
94+
static final String REGEX_CONF = "timestamp.regex";
9595
static final String TIMESTAMP_FORMAT_CONF = "timestamp.format";
9696

9797
// Kafka configuration description strings

test/lib/connect_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,13 @@
206206
"topics": "date_format",
207207
"splunk_hec_raw": False,
208208
"enable_timestamp_extraction" : "true",
209-
"regex": r"\\\"time\\\":\\s*\\\"(?<time>.*?)\"",
209+
"timestamp_regex": r"\\\"time\\\":\\s*\\\"(?<time>.*?)\"",
210210
"timestamp_format": "MMM dd yyyy HH:mm:ss.SSS zzz"},
211211
{"name": "test_extracted_timestamp_epochformat",
212212
"splunk_sourcetypes": "epoch_format",
213213
"topics": "epoch_format",
214214
"splunk_hec_raw": False,
215215
"enable_timestamp_extraction" : "true",
216-
"regex": r"\\\"time\\\":\\s*\\\"(?<time>.*?)\"",
216+
"timestamp_regex": r"\\\"time\\\":\\s*\\\"(?<time>.*?)\"",
217217
"timestamp_format": "epoch"}
218218
]

test/lib/connector.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"value.converter.schema.registry.url": "{{value_converter_schema_registry_url}}",
5050
"value.converter.schemas.enable": "{{value_converter_schemas_enable}}",
5151
"enable.timestamp.extraction": "{{enable_timestamp_extraction}}",
52-
"regex": "{{regex}}",
52+
"timestamp.regex": "{{timestamp_regex}}",
5353
"timestamp.format": "{{timestamp_format}}"
5454
}
5555
}

0 commit comments

Comments
 (0)