0

I am trying to search a log file for certain times which are stored in an array. I am then passing the matches back to a variable for further processing, but I am stumbling at the first hurdle. I am trying to pattern match with the following:

$times = "19/11/2014 23:56","19/11/2014 23:57","19/11/2014 23:58","19/11/2014 23:59"
Get-Content D:\tmp\App.log |  select-string -Pattern $times 

The App.log file looks like this:

19/11/14 23:59:11.470 [2752] INFO AppAdmin - Logon Request [email protected]
19/11/14 23:59:11.470 [2752] INFO AppAdmin - Logon Request for user = [email protected] succeeded. 19/11/14 23:59:12.687 [2752] INFO AppAdmin - onStreamOpened called: item = [email protected] 19/11/14 23:59:12.687 [2752] INFO AppAdmin - PrivateStreamEvents::onStreamOpened - message type 0: item = [email protected] 19/11/14 23:59:12.765 [2752] INFO AppAdmin - Logon Request [email protected]

So really the above lines should be passed to the console.

Any advice as to what could be going wrong?

Thanks!

1 Answer 1

2
19/11/14 23:59

Is not match to

19/11/2014 23:59
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.