All Apps and Add-ons

Help with time parsing error using GitLab Add-on.

jgbricker
Contributor

Please assist with what appears to be a date/time parsing issue:

Splunk Enterprise 7.3.1.

Python version info --

$ /opt/splunk/bin/splunk cmd python
Python 2.7.15 (default, Jun 24 2019, 17:39:18)
[GCC 5.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

ERROR log events after setting up and restarting Splunk to collect data for a specified project ID:

05-19-2020 14:10:46.781 -0400 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-gitlab-add-on/bin/get_events.py" Traceback (most recent call last):
05-19-2020 14:10:46.781 -0400 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-gitlab-add-on/bin/get_events.py"   File "/opt/splunk/etc/apps/TA-gitlab-add-on/bin/ta_gitlab_add_on/modinput_wrapper/base_modinput.py", line 127, in stream_events
05-19-2020 14:10:46.781 -0400 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-gitlab-add-on/bin/get_events.py"     self.collect_events(ew)
05-19-2020 14:10:46.781 -0400 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-gitlab-add-on/bin/get_events.py"   File "/opt/splunk/etc/apps/TA-gitlab-add-on/bin/get_events.py", line 72, in collect_events
05-19-2020 14:10:46.781 -0400 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-gitlab-add-on/bin/get_events.py"     input_module.collect_events(self, ew)
05-19-2020 14:10:46.781 -0400 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-gitlab-add-on/bin/get_events.py"   File "/opt/splunk/etc/apps/TA-gitlab-add-on/bin/input_module_get_events.py", line 203, in collect_events
05-19-2020 14:10:46.781 -0400 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-gitlab-add-on/bin/get_events.py"     if (datetime.strptime(r_loop['created_at'], '%Y-%m-%dT%H:%M:%S.%fZ')
05-19-2020 14:10:46.781 -0400 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-gitlab-add-on/bin/get_events.py"   File "/opt/splunk/lib/python2.7/_strptime.py", line 332, in _strptime
05-19-2020 14:10:46.781 -0400 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-gitlab-add-on/bin/get_events.py"     (data_string, format))
05-19-2020 14:10:46.781 -0400 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-gitlab-add-on/bin/get_events.py" ValueError: time data '2020-02-24T12:48:08.608-05:00' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'
0 Karma

jgbricker
Contributor

It seems like the following post is related -- https://stackoverflow.com/questions/41684991/datetime-strptime-2017-01-12t141206-000-0500-y-m-dthms-...

Hoping the developer can review this post and offer a suggested edit to 'input_module_get_events.py' or the appropriate script.

Thanks in advance

-jB

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Introducing the 2026 - 2027 SplunkTrust cohort!

The goal of the SplunkTrust™ membership has historically been to acknowledge and recognize those who go above ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...