Re: [Tutor] How to create a structure from a Log file

2019-03-11 Thread Bob Gailer
On Mar 11, 2019 2:53 AM, "Asad"  wrote:
>
> Hi All ,
>
>I think this format would be easy in a row and table format
>
> Date
> Time
> Message
> 1/21/2019
> 10:13:14.237 CET
> Method Entry. workDir=/tmp frameworkHome=/u01/app/oracle/product/
12.2.0.1/dbhome_1

For me the easiest would be to create an HTML page and display it in the
browser. You could start out with the table tag and then write each segment
of the log file into the proper column and end with a closing table tag.

I hope that's sufficient cuz I'm dictating this into my cell phone and
don't particularly want to try to actually dictate HTML or type it on a
cell phone keyboard.

Excel is also a good idea and there are several python modules dedicated to
creating Excel files. A Google search would reveal those.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to create a structure from a Log file

2019-03-11 Thread Asad
Hi All ,

   I think this format would be easy in a row and table format

Date Time  Message
1/21/2019 10:13:14.237 CET Method Entry. workDir=/tmp
frameworkHome=/u01/app/oracle/product/12.2.0.1/dbhome_1
I was also thinking of pandas but not sure how to proceed .

Thanks,

On Sun, Mar 10, 2019 at 7:47 PM Bob Gailer  wrote:

> Thank you for showing us a sample of the log file. That is half the
> battle. Would you now reformat a couple of the lines so that we can see how
> you'd like to see them.
>
> It also may be the case that the advice given by others will be sufficient
> to guide you
>


-- 
Asad Hasan
+91 9582111698
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to create a structure from a Log file

2019-03-10 Thread Bob Gailer
Thank you for showing us a sample of the log file. That is half the battle.
Would you now reformat a couple of the lines so that we can see how you'd
like to see them.

It also may be the case that the advice given by others will be sufficient
to guide you
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to create a structure from a Log file

2019-03-09 Thread Mark Lawrence

On 09/03/2019 18:44, Asad wrote:

Hi All ,

  Please a sample logfile

[main] [ 2019-01-21 10:13:14.041 CET ]
[AssistantLogHandler.configureLogging:176]  Begin tracing..
INFO: Jan 21, 2019 10:13:14 AM oracle.assistants.dbua.driver.UpgradeDriver
configureLogging
INFO: Loading upgrade driver,
  DBUA running in mode : NONE
  DBUA running on platform : Linux


[main] [ 2019-01-21 10:13:14.237 CET ]
[ClusterVerification.getInstance:553]  Method Entry. workDir=/tmp
frameworkHome=/u01/app/oracle/product/12.2.0.1/dbhome_1
[main] [ 2019-01-21 10:13:14.289 CET ] [CVUVariables.initialize:1456]
Start parse all variables from variables.xml...
[main] [ 2019-01-21 10:13:14.304 CET ]
[VerificationUtil.getVariablesXmlURI:10687]    XML variables file:
file:/u01/app/oracle/product/12.2.0.1/dbhome_1/cv/cvdata/variables.xml
[main] [ 2019-01-21 10:13:14.305 CET ]
[VerificationUtil.getVariablesXmlSchemaURI:10669]   XML variables
schema file: file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xsd
[main] [ 2019-01-21 10:13:14.305 CET ] [CVUVariables.getRootElement:1721]
 URIs obtained :xsd URI = file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xsd
[main] [ 2019-01-21 10:13:14.306 CET ] [CVUVariables.getRootElement:1722]
 URIs obtained :xml URI = file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xml
[main] [ 2019-01-21 10:13:14.306 CET ] [CVUVariables.getRootElement:1735]
xsdFile exists : file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xsd
[main] [ 2019-01-21 10:13:14.307 CET ] [CVUVariables.getRootElement:1750]
xmlFile exists : file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xml
[main] [ 2019-01-21 10:13:14.307 CET ] [CVUVariables.getRootElement:1763]
setting xmlFactory to use xsdFile : file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xsd
[main] [ 2019-01-21 10:13:14.408 CET ] [CVUVariables.getRootElement:1794]
The xml variables file: file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xml, was parsed correctly
[main] [ 2019-01-21 10:13:14.410 CET ] [CVUVariables.parse:1521]  Version
found ALL
[main] [ 2019-01-21 10:13:14.411 CET ] [CVUVariables.parse:1524]  Process
common variables
[main] [ 2019-01-21 10:13:14.415 CET ] [CVUVariableData.:98]
CVUVariableData created with names:  "s_silent,SILENT"
[main] [ 2019-01-21 10:13:14.416 CET ] [CVUVariables.parse:1521]  Version
found 12.2
[main] [ 2019-01-21 10:13:14.416 CET ] [CVUVariables.parse:1529]  Process
variables for the release: 12.2
[main] [ 2019-01-21 10:13:14.418 CET ] [CVUVariableData.:98]
CVUVariableData created with names:


I was thinking to convert it in a excel format  or any other format which
better viewable

Thanks,


I suggest that you start with this 
https://docs.python.org/3/library/stdtypes.html#string-methods to grab 
your data.  Then how about https://docs.python.org/3/library/csv.html 
for writing your data.  Should this not be adequate please let us know 
and we'll get you sorted :)


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to create a structure from a Log file

2019-03-09 Thread Asad
Hi All ,

 Please a sample logfile

[main] [ 2019-01-21 10:13:14.041 CET ]
[AssistantLogHandler.configureLogging:176]  Begin tracing..
INFO: Jan 21, 2019 10:13:14 AM oracle.assistants.dbua.driver.UpgradeDriver
configureLogging
INFO: Loading upgrade driver,
 DBUA running in mode : NONE
 DBUA running on platform : Linux


[main] [ 2019-01-21 10:13:14.237 CET ]
[ClusterVerification.getInstance:553]  Method Entry. workDir=/tmp
frameworkHome=/u01/app/oracle/product/12.2.0.1/dbhome_1
[main] [ 2019-01-21 10:13:14.289 CET ] [CVUVariables.initialize:1456]
Start parse all variables from variables.xml...
[main] [ 2019-01-21 10:13:14.304 CET ]
[VerificationUtil.getVariablesXmlURI:10687]    XML variables file:
file:/u01/app/oracle/product/12.2.0.1/dbhome_1/cv/cvdata/variables.xml
[main] [ 2019-01-21 10:13:14.305 CET ]
[VerificationUtil.getVariablesXmlSchemaURI:10669]   XML variables
schema file: file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xsd
[main] [ 2019-01-21 10:13:14.305 CET ] [CVUVariables.getRootElement:1721]
 URIs obtained :xsd URI = file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xsd
[main] [ 2019-01-21 10:13:14.306 CET ] [CVUVariables.getRootElement:1722]
 URIs obtained :xml URI = file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xml
[main] [ 2019-01-21 10:13:14.306 CET ] [CVUVariables.getRootElement:1735]
xsdFile exists : file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xsd
[main] [ 2019-01-21 10:13:14.307 CET ] [CVUVariables.getRootElement:1750]
xmlFile exists : file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xml
[main] [ 2019-01-21 10:13:14.307 CET ] [CVUVariables.getRootElement:1763]
setting xmlFactory to use xsdFile : file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xsd
[main] [ 2019-01-21 10:13:14.408 CET ] [CVUVariables.getRootElement:1794]
The xml variables file: file:/u01/app/oracle/product/
12.2.0.1/dbhome_1/cv/cvdata/variables.xml, was parsed correctly
[main] [ 2019-01-21 10:13:14.410 CET ] [CVUVariables.parse:1521]  Version
found ALL
[main] [ 2019-01-21 10:13:14.411 CET ] [CVUVariables.parse:1524]  Process
common variables
[main] [ 2019-01-21 10:13:14.415 CET ] [CVUVariableData.:98]
CVUVariableData created with names:  "s_silent,SILENT"
[main] [ 2019-01-21 10:13:14.416 CET ] [CVUVariables.parse:1521]  Version
found 12.2
[main] [ 2019-01-21 10:13:14.416 CET ] [CVUVariables.parse:1529]  Process
variables for the release: 12.2
[main] [ 2019-01-21 10:13:14.418 CET ] [CVUVariableData.:98]
CVUVariableData created with names:


I was thinking to convert it in a excel format  or any other format which
better viewable

Thanks,
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to create a structure from a Log file

2019-03-09 Thread Mats Wichmann
On March 9, 2019 6:08:03 AM MST, Asad  wrote:
>Hi All ,
>
>   I would like to know , how can I approach this problem to create
>a easy structure from the logfile using python so I can review the
>logfiles
>quite efficiently . Please share suggestion tip or already written
>codes.
>
>
>
>Thanks,
>___
>Tutor maillist  -  Tutor@python.org
>To unsubscribe or change subscription options:
>https://mail.python.org/mailman/listinfo/tutor

The great things about logfiles is they're (typically) all text, and they have 
regular, prredictable  contents.  Before you can do anything useful, though, 
you have to figure out the pattern of the contents.  That can vary wildly... in 
a system logfile there may be many programs that contribute so the patterns can 
take more work to figure out; if it's a logfile for one specific program, it 
may be easier.  What kinds of things are you looking for?  What kind of data 
are you expecting?

You should be able to find lots of  examples of logfile processing on the 
internet, but whether any of that is of any use to you beyond providing a model 
for techniques is up to whether your logfile is like any of the ones being 
processed in those examples.

As in other replies - tell us more.   Also, just a general comment, this list 
usually works out better if you have more specific questions (I tried AAA and 
instead of giving me BBB I got CCC),
-- 
Sent from a mobile device with K-9 Mail. Please excuse my brevity.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to create a structure from a Log file

2019-03-09 Thread Alan Gauld via Tutor
On 09/03/2019 13:08, Asad wrote:

>I would like to know , how can I approach this problem to create
> a easy structure from the logfile using python so I can review the logfiles
> quite efficiently . Please share suggestion tip or already written codes.

That depends on several things:

1) What is the format of the log file?
2) what data does it contain
3) what data do you need to see and organised by what criteria?
4) What do you mean by efficiency?
   - Speed of processing the logfile?
   - Speed of writing the reports?
   - Speed of generating the reports?

The OS and Python version would be useful too.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to create a structure from a Log file

2019-03-09 Thread Bob Gailer
Would you give us more information? What is an example of a log file? How
would you like to see it presented? The more information you give us the
easier it is for us to help.

On Mar 9, 2019 11:20 AM, "Asad"  wrote:

Hi All ,

   I would like to know , how can I approach this problem to create
a easy structure from the logfile using python so I can review the logfiles
quite efficiently . Please share suggestion tip or already written codes.



Thanks,
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] How to create a structure from a Log file

2019-03-09 Thread Asad
Hi All ,

   I would like to know , how can I approach this problem to create
a easy structure from the logfile using python so I can review the logfiles
quite efficiently . Please share suggestion tip or already written codes.



Thanks,
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor