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
Get Updates on the Splunk Community!

Credit Card Data Protection & PCI Compliance with Splunk Edge Processor

Organizations handling credit card transactions know that PCI DSS compliance is both critical and complex. The ...

Stay Connected: Your Guide to July Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...