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

Redline Import in tsctl #603

Merged
merged 11 commits into from Jun 24, 2018
Merged

Redline Import in tsctl #603

merged 11 commits into from Jun 24, 2018

Conversation

jaegeral
Copy link
Collaborator

As discussed here:
#601

That adds the capability to import redline files using CLI.

What I have not done yet is made it exposed to the WebUI.

But IMHO it is a good point to start with

If the new introduced helper methods are not wanted, it is easy to move that code in the method itself.

Once it is okay to merge, I would also mention it in the README file of course

@jaegeral
Copy link
Collaborator Author

Ok I have no idea why travis failed, help is appreciated @adamjnichols @berggren ?

@berggren
Copy link
Contributor

This is because the linter complains:
************* Module timesketch.lib.utils
C: 42, 0: Line too long (81/80) (line-too-long)

I'm reviewing the code tomorrow :) We will rerun Travis when done.

@@ -36,6 +36,30 @@ def random_color():
rgb = tuple(int(i * 256) for i in colorsys.hsv_to_rgb(hue, 0.5, 0.95))
return u'{0:02X}{1:02X}{2:02X}'.format(rgb[0], rgb[1], rgb[2])

# to avoid hickups in timesketch, some newlines, commas etc will be removed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need this. What happens in Timesketch? What do you mean with hickup?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skipt this one for now, add tests later.

@@ -36,6 +36,30 @@ def random_color():
rgb = tuple(int(i * 256) for i in colorsys.hsv_to_rgb(hue, 0.5, 0.95))
return u'{0:02X}{1:02X}{2:02X}'.format(rgb[0], rgb[1], rgb[2])

# to avoid hickups in timesketch, some newlines, commas etc will be removed
def clean_summary(argument):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renove function

# method to create the datetime
def convert_date_to_datetime(argument):
argument = argument.replace('Z', '')
d = datetime.datetime.strptime(argument, '%Y-%m-%d %H:%M:%S')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dt = parser.parse(timestring)
timestamp = int(time.mktime(dt.timetuple())) * 1000

argument = argument.replace('Z', '')
d = datetime.datetime.strptime(argument, '%Y-%m-%d %H:%M:%S')
iso_date = d.isoformat()
iso_date_new = iso_date + "+00:00"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just replace this with:
dt.isoformat()



# method to create the datetime
def convert_date_to_datetime(argument):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename to convert_to_isoformat

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@jaegeral
Copy link
Collaborator Author

test

@jaegeral jaegeral changed the title Redline Import Redline Import in tsctl Jun 24, 2018
@jaegeral
Copy link
Collaborator Author

I commited that with a wrong usermail in my config but I already signed the CLA with my right account

@berggren
Copy link
Contributor

The CLA bot is confused again. I'm sitting next to @deralexxx and confirm he is the one pushing commits.

@berggren berggren merged commit ae183ab into google:master Jun 24, 2018
@berggren berggren deleted the redlineimport branch June 24, 2018 08:49
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

Successfully merging this pull request may close these issues.

None yet

4 participants