Add to Technorati Favorites
Welcome to ThePowerShellGuy.com Sign in | Join | Help

Hey Scripting guy !

After a silent changing of guards : About The Scripting Guys

The new Scripting guy's  Ed Wilson and Craig Liebendorfer took over, the weekly Windows PowerShell Tips seems to have stopped by then and my searchfeed for new items at the Technet Script Center seemed to have stopped working at about the time of the takeover, so hence I kind a lost track and missed al new  "PowerShell Style" Hey Scripting Guy articles since then,

The Current list of "new PowerShell Style" hey Scripting Guy articles since then, with only one exception all in PowerShell !!,

October 2008


Week of October 3rd, 2008

How Can I Reuse Functions? (Thurs. - 10/2/08)
How Can I Enable or Disable My Network Adapter? (Mon. - 9/29/08)

September 2008


Week of September 26th, 2008

Australian Dispatch #2: A Metric Ton of Scripting (Thurs. - 9/25/08)
Australian Dispatch #1: How Does a Scripting Guy Pack for a Trip (Mon. - 9/22/08)


Week of September 19th, 2008

How Can I Tell When I Last Logged On? (Thurs. - 9/18/08)
How Do I Write to Excel Without Using Excel? (Mon. - 9/15/08)


Week of September 12th, 2008

How Do I Read from Excel Without Using Excel? (Thurs. - 9/11/08)
How Do I Find Information About the Network Adapter Cards on My Computer? (Mon. - 9/8/08)


Week of September 5th, 2008

How Can I Tell When I Was Last Logged On? (Thurs. - 9/4/08)
How Do I Use Windows PowerShell to Run the Same WMI Queries Against Multiple Computers? (Tues. - 9/2/08)

August 2008


Week of August 29th, 2008

What's Going on in the Service Host Process? (Thurs. - 8/28/08)
How Can I Troubleshoot Drive-Mapping Issues? (Mon. - 8/25/08) (VbScript)


Week of August 22nd, 2008

How Do I Track Server Downtime? (Thurs. - 8/21/08)
How Long Has My Server Been Up? (Mon. - 8/18/08)


Week of August 15th, 2008

How Can I Find Files' Metadata? (Wed. - 8/13/08)
When Will We Land? (Mon. - 8/11/08)

I think I can really stop my Hey PowerShell Guy ! series ( see also Hey, PowerShell Guy ! How Can I .. Sorry forget about it I allready Know . and  Hey PowerShell Guy!, How Can I Retrieve Time Zone Information for a Computer? )

So be sure to follow this series (and beg the new Scripting guys for a new RSS feed)

Enjoy,

Greetings /\/\o\/\/

Published Sunday, October 05, 2008 5:34 AM by MoW
Filed under:

Comments

# how can I use get-content to analyze sql server logfile ?

my problem is that SQL server log file looks like this

2008-07-16 09:51:51.40 spid3 "OK"  

2008-07-16 09:51:52.04 spid3 "OK"  

2008-07-16 09:51:52.04 spid5 "OK"  

2008-07-16 09:51:52.04 spid3 "OK"  

2008-07-16 09:51:52.04 spid5 "ERROR:"  

2008-07-16 09:51:52.04 spid3 "OK"  

2008-07-16 09:51:52.04 spid5 "ERROR:"  

2008-07-17 09:51:52.04 spid5 "ERROR:"  

2008-07-17 09:51:52.04 spid3 "OK"  

2008-07-18 09:51:52.04 spid5 "ERROR:"  

2008-07-18 09:51:52.04 spid5 "OK"  

2008-07-18 09:51:52.04 spid5 "ERROR:"  

I want to be be able to search for errors

(see also "ERROR:" only when the date is yesterday or today .

(for this exmaple assume that today is 2008-07-18

I was able to filter the errors but I need to filter only the spexific dates

since I do not want to see old errors

note that in SQL Server the location of dates are always the same .

I assume I need to use the substring with

select-String but I am not sure and I do not know how.

this my code

Get-Content c:\sample_ERRORLOG.txt | Select-String "ERROR:"  

thanks in advance

Ran

Thursday, October 23, 2008 5:52 PM by ranmel

# re: Hey Scripting guy !

Hi Ran,

nice question my first answer you can find here, it is not very clear yet but it works, I will follow up in this later,

http://thepowershellguy.com/blogs/posh/archive/2008/10/24/hey-powershell-guy-how-can-i-use-get-content-to-analyze-sql-server-logfile.aspx

Greetings /\/\o\/\/

Friday, October 24, 2008 9:06 PM by MoW

# Episode 49 - Lee Holmes « PowerScripting Podcast

Sunday, November 09, 2008 10:23 PM by Episode 49 - Lee Holmes « PowerScripting Podcast

# re: Hey Scripting guy !

I just heard from Ed Wilson and there is a site migration planned for next year which will help automate the RSS setup.  Until then, it is a manual process.

Cheers.

Monday, December 15, 2008 1:41 PM by kboomsliter
Anonymous comments are disabled