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

Error on CSV import #565

Closed
geekscrapy opened this issue Mar 20, 2018 · 6 comments
Closed

Error on CSV import #565

geekscrapy opened this issue Mar 20, 2018 · 6 comments

Comments

@geekscrapy
Copy link

geekscrapy commented Mar 20, 2018

Getting the following error upon import:

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/timesketch/lib/tasks.py", line 143, in run_csv_jsonl for event in read_and_validate(source_file_path, delimiter): File "/usr/local/lib/python2.7/dist-packages/timesketch/lib/utils.py", line 52, in read_and_validate_csv reader = csv.DictReader(fh, delimiter=delimiter.decode('string_escape')) File "/usr/lib/python2.7/csv.py", line 79, in __init__ self.reader = reader(f, dialect, *args, **kwds) TypeError: "delimiter" must be an 1-character string

I'm using the following snippet to generate the code (python 2):

writer = csv.DictWriter(write_file, fieldnames=fieldnames, quoting=csv.QUOTE_ALL, delimiter=',', quotechar='"', dialect='excel')

writer.writerow({'message':line.strip(), 'timestamp':timestamp, 'datetime':isodatetime, 'timestamp_desc':'test'})

@geekscrapy
Copy link
Author

FYI, copy and paste of the example CSV gives the same result:

message,timestamp,datetime,timestamp_desc,extra_field_1,extra_field_2
A message,1331698658276340,2015-07-24T19:01:01+00:00,Write time,foo,bar

@adamjnichols
Copy link
Contributor

Hi there! I'm not clear what you're trying to do. It looks as though you're invoking Timesketch as a library. Can you tell me more about how you're trying to import the csv?

@geekscrapy
Copy link
Author

Hi!

I'm importing via the CVS upload functionality in the /timelines page.

@adamjnichols
Copy link
Contributor

Are you using the most recent clone from master?

@adamjnichols
Copy link
Contributor

See #548

@geekscrapy
Copy link
Author

Yup this is fixed in that issue

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

No branches or pull requests

2 participants