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

Fixed Get-LogWinEvent, updated README.MD #200

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

dmoore44
Copy link
Contributor

Fixed issue with Get-LogWinEvent to deal with issue #199. Also updated README.MD to provide guidance on some of the newer features integrated in to Kansa.

.EXAMPLE
Get-LogWinEvent.ps1 Security
Multiple logs, over the past 7 days, with specified Event IDs
Get-LogWinEvent.ps1 Security|System-7-4625|4634|4798|267|507
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not trying to nitpick, but it looks like the event ids here are mostly from the security event log. I know they are just examples, but examples would be better if they were correct. If I'm wrong, my apologies.

I have not tested this syntax yet. Have you? How does the code determine that the pipe separated values are event logs v event ids?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

...it looks like the event ids here are mostly from the security event log...

No - you're correct. Those event IDs are mostly from the security log - I was pulling IDs from memory when writing the example, and those are just happen to be ones I query for the most.

I have not tested this syntax yet. Have you?

I have tested the syntax and it works as expected. I specify in the comments that the "params" parameter follows an exacting format: "The format for this parameter follows this syntax: log name(s) [separated by a pipe if you want to specify more than one]-days ago-event IDs [separated by a pipe if you want to specify more than one]."

How does the code determine that the pipe separated values are event logs v event ids?

There are no explicit checks to ensure proper ordering of data passed to the "params" parameter. Params is explicitly cast as a string in its declaration statement and then immediately split in the appropriately type cast variables. Beyond that, there is no checking that a given log name is valid (that, I think would be rather un do-able given the number of event log collections available), or that the data passed in is entered in the correct order.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So if a user passes in multiple logs (e.g. Security, System, etc.) and a string of event IDs, does the code look in each log for all the given event IDs?

@dmoore44
Copy link
Contributor Author

dmoore44 commented May 7, 2020

Functionally speaking, yes.

There’s a check to see if the user specified any event IDs. If so, the function will iterate through each specified log for the requested IDs.

If there’s no specified event IDs, the function will query each specified event log and return all log entries.

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

2 participants