Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Multiple strptime formats in token replacement #369

Open
jmeixensperger opened this issue Apr 2, 2020 · 1 comment
Open

[BUG] Multiple strptime formats in token replacement #369

jmeixensperger opened this issue Apr 2, 2020 · 1 comment
Assignees
Labels
bug Malfunctioning Eventgen due to potential bug

Comments

@jmeixensperger
Copy link
Contributor

jmeixensperger commented Apr 2, 2020

Describe the bug
Events are not generated when I use multiple strptime expressions for a single token.

To Reproduce
Generate with included files

Expected behavior
Both strptime expressions are evaluated/written with the correct replaytimestamp

Actual behavior
Nothing is generated

Sample files and eventgen.conf file
eventgen.conf:

[sample.mobilemusic.csv]
sampletype = csv
outputMode = stdout
end = 1
mode = replay

token.0.token = ((\w+\s+\d+\s+\d{2}:\d{2}:\d{2}:\d{3})|(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}:\d{3}))
token.0.replacementType = replaytimestamp
token.0.replacement = ["%b %d %H:%M:%S:%f", "%Y-%m-%d %H:%M:%S:%f"]

sample:

index,host,source,sourcetype,_raw
eventgenTest,splunk,/var/log/radius.log,radius,May 27 18:28:11:000 aaa2 radiusd[12676]:[ID 959576 local1.info] INFO RADOP(13) acct start for 5559031692@splunktel.com 10.94.63.34 from 130.253.37.97 recorded OK.
eventgenTest,splunk,/var/log/httpd/access_log,access_custom,"2012-05-27 18:28:11:112 10.2.1.35 POST /playhistory/uploadhistory - 80 - 10.94.63.34 ""Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3"" 503 0 0 468 1488"
eventgenTest,splunk,/var/log/httpd/access_log,access_custom,"2012-05-27 18:28:11:125 10.2.1.35 GET /sync/addtolibrary/01011207201000005652000000000047 - 80 - 10.94.63.34 ""Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3"" 200 0 0 468 1488"
eventgenTest,splunk,/var/log/httpd/access_log,access_custom,"2012-05-27 18:28:11:137 10.2.1.35 GET /sync/addtolibrary/01011207201000005652000000000047 - 80 - 10.94.63.34 ""Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3"" 503 0 0 468 1488"
eventgenTest,splunk,/var/log/radius.log,radius,May 27 18:28:11:199 aaa2 radiusd[12676]:[ID 959576 local1.info] INFO RADOP(13) acct stop for 5559031692@splunktel.com 10.94.63.34 from 130.253.37.97 recorde

Do you run eventgen with SA-eventgen?
No

If you are using eventgen with pip module mode (please complete the following information):

  • python version: 3.6
  • OS: MacOS
  • Virtual Env is used: Yes
  • Eventgen Version: 7.0.0

Additional context
Relevant token.X.replacement docs on passing a list of strptime expressions (seems supported): "For ["list","of","strptime"], only used with replaytimestamp, a JSON formatted list of strptime formats to try."

@jmeixensperger jmeixensperger added the bug Malfunctioning Eventgen due to potential bug label Apr 2, 2020
@jmeixensperger
Copy link
Contributor Author

jmeixensperger commented Apr 2, 2020

On second thought, I don't think this is the right/accepted approach, nor required by anyone right now--Closing
This conf actually came from our own tutorial4. It's not being used anywhere, but there is also a small mention of this feature in our docs. We should investigate the issue and add tests/docs for this feature if we plan on supporting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Malfunctioning Eventgen due to potential bug
Projects
None yet
Development

No branches or pull requests

5 participants