Friday, December 16, 2011

Log Parser for Analyzing IIS Logs



Often we might come across situations where we need to analyze some of production log file. No doubt there are tools available in the market which provides a good logging capability, however one of the useful tools from Microsoft is Log Parser. Log Parser can be downloaded from @ http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=24659 . Below are the steps that I have used to analyze few scenarios top 10  pages of my web site, average bandwidth etc


Steps to analyze the logs using Log Parser.

Prerequisites
1.       Enable IIS logging and enable all the extended fields (if not all the ones that are listed below). This can be done in IISàWebSiteàPropertiesàEnable Logging (checkbox) à Properties and then check all the fields that are required.
2.       Please change the folder name and file name of the log files in below query. Please note the * in the query which is for the wild search. In this case we are going to query multiple files at once.
3.       Please ensure Log Parser tool is available.
Step 1: Identify Top 10 D+ (classic ASP pages)
Run the below query and  output will be stored in  Top10ClassicASP.csv  file
Logparser "Select TOP 10 STRCAT(EXTRACT_PATH(cs-uri-stem),'/') AS RequestPath, EXTRACT_FILENAME(cs-uri-stem) AS RequestedFile, COUNT(*) AS TotalHits, Max(time-taken) AS MaxTime, AVG(time-taken) AS AvgTime, AVG(sc-bytes) AS AvgBytesSent into Top10ClassicASP.csv FROM C:\IISLogs\ex11121*.log where cs-uri-stem like '%.asp'  GROUP BY cs-uri-stem ORDER BY TotalHits DESC"
Step 2: Identify the top 10 .Net pages
Run the below query and output will be stored in Top10ASPX.csv  file
Logparser "Select TOP 10 STRCAT(EXTRACT_PATH(cs-uri-stem),'/') AS RequestPath, EXTRACT_FILENAME(cs-uri-stem) AS RequestedFile, COUNT(*) AS TotalHits, Max(time-taken) AS MaxTime, AVG(time-taken) AS AvgTime, AVG(sc-bytes) AS AvgBytesSent into Top10ASPX.csv FROM C:\IISLogs\ex11121*.log where cs-uri-stem like '%.aspx%'  GROUP BY cs-uri-stem ORDER BY TotalHits DESC"
Step 3:  Response time for top 10 pages
Below query gives response time for 100 Hits of each page (Here is an example for login.aspx page). We need to perform this for each Classic ASP and ASP.Net page. Please change the csv file name.
Logparser "Select TOP 100 STRCAT(EXTRACT_PATH(cs-uri-stem),'/') AS RequestPath, EXTRACT_FILENAME(cs-uri-stem) AS RequestedFile, Date, Time,s-computername as ServerName,sc-bytes as BytesSent,time-taken as TimeTaken,s-sitename as SiteName,cs-username as UserName,sc-status as HttpStatus into login.csv FROM C:\IISLogs\ex11121*.log where cs-uri-stem like '%login.aspx' and  sc-status =200 and time-taken > 0 ORDER BY Date DESC"
Step 4: Average network Bandwith/half an hour (Average KiloBytes sent and received by the server per half an hour)
Run the below query and output will be stored in AvgKBytesPerHalfanHour.csv
logparser "SELECT TO_LOCALTIME(QUANTIZE(time, 1800)) as HalfHour, ADD(SCKBytesSec, CSKBytesSec) as KBytesSec USING DIV(DIV(MUL(1.0, SUM(sc-bytes)), 1024), 1800) as SCKbytesSec, DIV(DIV(MUL(1.0, SUM(cs-bytes)), 1024), 1800) as CSKBytesSec INTO AvgKBytesPerHalfanHour.csv FROM C:\IISLogs\ex11121*.log  GROUP BY HalfHour ORDER BY HalfHour ASC"
Step 5: Average network Bandwith/half an hour (Average KiloBytes sent by the server per half an hour)
logparser "SELECT TO_LOCALTIME(QUANTIZE(time, 1800)) as HalfHour, SCKBytesSec as KBytesSec USING DIV(DIV(MUL(1.0, SUM(sc-bytes)), 1024), 1800) as SCKbytesSec INTO AvgKBytesPerHalfanHourSent.csv FROM C:\IISLogs\ex11121*.log  GROUP BY HalfHour ORDER BY HalfHour ASC"
Step 6: Average network Bandwith/half an hour (Average KiloBytes received by the server per half an hour)
logparser "SELECT TO_LOCALTIME(QUANTIZE(time, 1800)) as HalfHour, CSKBytesSec as KBytesSec USING DIV(DIV(MUL(1.0, SUM(cs-bytes)), 1024), 1800) as CSKBytesSec INTO AvgKBytesPerHalfanHourReceived.csv FROM C:\IISLogs\ex11121*.log  GROUP BY HalfHour ORDER BY HalfHour ASC"




Hope this helps.....

Wednesday, December 14, 2011

Where can I get the Personal edition of PEGA Or PRPC Personal Edition 6.2 SP1 (32-bit and 64-bit versions)


The PEGA personal edition is meant for only PEGA clients and partners only. The Personal Edition is individually licensed. Each download is tagged to a single named individual, and requires registration and authorization from Pegasystem’s  Sales or Partner Support organization. You must register with your corporate email account using the form @ http://www.pega.com/Products/Quicktour/default.asp

Please note that your request will not be accepted if you are using the personal email id.

Once your request is approved you will receive an confirmation with the details to download the software.

Friday, December 9, 2011

What is PEGA? What is PEGA PRPC or What is PRPC?



My journey to PEGA starts from here starting from the very basic questions.

Q. What is PEGA?

Pega is the software for customer centricity. Many of the world’s leading organizations use Pega to drive revenue growth, improve customer experience, and enhance operational efficiency. Pega’s unified offering is recognized by industry analysts as a leader in CRMBPMcase management and business rules. Pega’s software complements existing systems and offers a wide range of industry applications designed to accelerate time to market. 


Q. What is PEGA PRPC or What is PRPC?


PRPC (PegaRULES Process Commander) is a software product created, licensed, and marketed by Pegasystems Inc (PEGA). PRPC is the core component of Pegasystems's "SmartBPM" suit of BPM (Business Process Management) solutions.

PegaRULES Process Commander comes essentially as two discreet entities,
  • PegaRULES : Core Java-based/Object-Oriented Rules Engine.
  • Process Commander : Layers of pre-configured rules that provide a solid foundation on which to perform development and customization.
Incorporating both of the following components, PRPC addresses simple to complex business challenges:
  • BPM
    • Procedural processing through a user-interactive BPM / BPMS(BPM Suite) tool.
  • BRE
    • Declarative "On-Change" processing through an event-driven tool.
The advantages that PRPC offers from a Business perspective are as follows:
  • Software platform enabling businesses the opportunity to migrate all their disparate, diverse, and often complex business rules onto one platform.
  • Ability to streamline, automate, and document business processes.
  • Consolidate multi-stream processes into one system.
  • Through service connectors (such as SOAP, MQ, active file listening) connect to existing enterprise applications.
  • Pass data between systems and have such information parsed, extracted, and interpreted.
The advantages that PRPC offers from a Developer perspective are as follows:
  • Development can be achieved in small iterative-based parts
  • Development is contained within heavily graphic-driven 'Rule Forms' that are version and ruleset controlled.
  • All run-time Java code is compiled and executed by the system at run-time.
  • Changes or new configurations can be tested in real-time, even on production systems without affecting other users or processes.
Ultimately PRPC is a software platform that allows businesses the opportunity to migrate all their disparate, diverse and often complex business rules, practices and processes into one platform. The platform offers the possibility of streamlining, automating and documenting business processes in a way that can truly allow consolidation of multi-stream processing into one system. Through PRPC's myriad service connection capabilities (such as SOAP, MQ, active file listening on directories etc...), it is possible to connect already existing enterprise applications to PRPC and pass to the platform messages, data or information and have such information parsed, extracted and interpreted for use either within user driven processes, or even system-driven events.

So, what does that really mean?

Think of PRPC as a box of sophisticated Lego. You are provided with a number of building blocks that enable you to quickly and easily build an application to suite the requirements of your business. The Lego blocks (or Rules as Pegasystems calls them) represent different parts of your application. There are rules for screens, decisions, correspondence, interfacing to external systems, etc. You can take these rules and put them together to design and build your solution.
This also means that it is very simple and easy to change your solution to suit the ever changing requirements of the business - you simply change the lego bricks around!!

Q. What is Rule Engine or What is BRE (Business Rule Engine)?

A business rules engine (BRE) is a software component that allows non-programmers to add or change business logic in a business process management (BPM) system. A business rule is a statement that describes a business policy or procedure. Business logic describes the sequence of operations that is associated with data in a database to carry out the rule.

A business rules engine works by separating execution code for business rules from the rest of the business process management system. This allows the end user to change business rules without having to ask a programmer BPM development
for help. When a change is made, the engine will evaluate the change's effect on other rules in the system and flag the user if there is a conflict.

According to authors Alex Berson and Larry Dubov, a complete business rules engine will include the following:
·        Business Rule Repository - A database for storing the business rules as defined by the business users.
·      Business Rule Editor - An intuitive user interface that allows business users to define, design, document and edit business rules.
·        Reporting Component - An intuitive user interface that allows business users to query and report existing rules.
·        Rules Engine Execution Core - The actual programming code that enforces the rules.