Reading log file

Hi all ,
I want to view a particular log file. Is there any transaction to view log files.Do i need basis rights for that?

$Path="C:\Times.log"
remove-item $Path
Add-Content $Path '<time="11:10:58.000+000">'
Add-Content $Path '<time="12:10:58.000+000">'
Add-Content $Path '<time="13:10:58.000+000">'
Add-Content $Path '<time="15:13:38.000+000">'
Add-Content $Path '<time="16:10:58.000+000">'
Add-Content $Path '<time="17:08:28.000+000">'
$File=Get-Content $Path
$StartTime=$Null
$EndTime=$Null
$ElapsedTime = $Null
ForEach ($Line in $File)
If ($Line.Contains("time="))
$Position = $Line.IndexOf("time=")
$TimeStr =$Line.SubString($Position+6,8)
IF ($StartTime -EQ $Null)
$StartTime = $TimeStr -As [System.TimeSpan]
Else
$EndTime = $TimeStr -As [System.TimeSpan]
$ElapsedTime = $EndTime.Subtract($StartTime)
"StartTime=$StartTime EndTime=$EndTime ElapsedTime=$ElapsedTime"
$StartTime = $Null
Gives this output
StartTime=11:10:58 EndTime=12:10:58 ElapsedTime=01:00:00
StartTime=13:10:58 EndTime=15:13:38 ElapsedTime=02:02:40
StartTime=16:10:58 EndTime=17:08:28 ElapsedTime=00:57:30

Similar Messages

  • Reading .log file & Sorting input

    Hello all
    Currently I'm working on a projekt were I have to read a "in.log" file, sort it and save it to another "out.log" file, the contents of the in.log file is:
    [204.0.44.73]: Dir: path
    [204.0.44.73]: Dir: path
    [204.0.44.74]: Dir: path
    [204.0.44.73]: Dir: path
    [204.0.44.74]: Dir: path
    and so on, now what I have to end up with is this in the out.log:
    #1
    [204.0.44.73]: Dir: path
    [204.0.44.73]: Dir: path
    [204.0.44.73]: Dir: path
    Count = 3
    #2
    [204.0.44.74]: Dir: path
    [204.0.44.74]: Dir: path
    Count = 2
    It's for the system administrator at school who doesn't want to do it himself but wants to pay an amount for me to do it (very small amount). I'll pay max duke dollars for a reply which can help me..
    Please help, thx in advance

    I must be really bored... Use it with "java Parser <logname>"
    import java.io.*;
    import java.util.*;
    public class Parser{
         public void splitLog( File input ){
              try{
                   FileInputStream fis = new FileInputStream( input );
                   BufferedReader br = new BufferedReader( new InputStreamReader( fis ) );
                   Hashtable hosts = new Hashtable();
                   String line;
                   while( ( line = br.readLine() ) != null ){
                        StringTokenizer st = new StringTokenizer( line, "]" );
                        if( st.hasMoreTokens() ){
                             String host = st.nextToken();
                             if( host.trim().startsWith("[") ){
                                  host = host.trim().substring(1);
                             if( !hosts.containsKey( host ) ){
                                  hosts.put( host, new Vector() );
                             Vector v = (Vector)hosts.get( host );
                             v.addElement( line );
                   Enumeration enum = hosts.keys();
                   while( enum.hasMoreElements() ){
                        String host = (String)enum.nextElement();
                        Vector v = (Vector)hosts.get(host);
                        FileOutputStream fos = new FileOutputStream( host + ".log" );
                        for( int i = 0; i < v.size(); i++ ){
                             line = (String)v.elementAt( i );
                             fos.write( (line + "\r\n").getBytes());
                        fos.close();
              catch( Exception e ){
                   e.printStackTrace();
         public static void main( String[] args ){
              File input = new File( args[0] );
              Parser parser = new Parser();
              parser.splitLog( input );
    }

  • IMP: How to Read LOG Files

    Hey Gurus,
       I want to read the log files after executing SE37 t-codes, I tried in sm21 but i didnt get any result.
       Can U tell me how to read the log files ??
       what is T-code for that? or i have change any settings???
      Thanking You,
        Regards
       J Sarathi

    Hi ,
    You can use these two FM for analysing the log ..
                   APPL_LOG_READ_INTERN
                   APPL_LOG_DISPLAY_INTERN
    Or You can create A Zprogram using this FM
    and check the changes using RSDEPEND

  • Allowing special user to read log files [Solved]

    Hi
    I want to add a group (log) that has the privledges to read /var/log files
    and then add my user to that group.
    How do i accomplish this
    This is to run root-tail in .xinitrc
    Or is there an other way?
    //Clanman

    [root@master fredrik]# ls -al /usr/bin/root-tail
    -rwxr-xr-x  1 root root 22600 2006-01-08 04:58 /usr/bin/root-tail
    [root@master fredrik]# chmod 640 /usr/bin/root-tail
    [root@master fredrik]# ls -al /usr/bin/root-tail
    -rw-r-----  1 root root 22600 2006-01-08 04:58 /usr/bin/root-tail
    [root@master fredrik]# chgrp log /usr/bin/root-tail
    [root@master fredrik]# ls -al /usr/bin/root-tail
    -rw-r-----  1 root log 22600 2006-01-08 04:58 /usr/bin/root-tail
    exiting root
    fredrik@master ~]$ root-tail -g 800x250+10+10 -justify -fn '-*-verdana-*-*-*-*-10-*-*-*-*-*-*-*' /var/log/errors.log,orange,'ALERT'
    -bash: /usr/bin/root-tail: Permission denied
    Still no go
    //Clanman

  • Where are adobe reader log files?

    Where are the log files for Adobe Reader?
    When one of our clients opens a form off our liquid office server we receive an error.  If possible I would like to find a log file that might give some sort of clue as to why this is happening.  Thanks

    I'll make an inquiry about that and if we have to contact liquid office at some point my guess is they may request that we do that if there is likely to be any useful information there.  It is likely going to be pretty difficult as we have lots of clients opening forms constantly throughout the day.
    I did find adobearm log file and also adobereaerbroker log file in the temp files on my own.  So it does seem like reader logs some of it's activities.  I haven't examined them completely yet but a quick comparison between a working machine opening our problem form and the one the computer that doesn't open it properly seems to show no obvious differences.  They both seem to show problems with access denied and registry entries.  However one works and the other doesn't even with the same issues in the log.

  • Any ideas creating app to read log file when updated?

    Afternoon all,
    I have been asked to write a java app which will read the contents of the server log file every time the log file is updated by the server. The app will be deployed onto WebSphere Application Server.
    Can anyone point me in the right direction as I have never written anything like this before and I don't know where to start. Any help will be much appreciated.
    Thanks in advance,
    A.

    alex@work wrote:
    I agree with most of what you've said but unfortunately I don't have a say in what the company wants. However, I am interested in the appender idea, perhaps they may go for that if I suggest it.I'd say it'll take you a day to read up about Log4J and how to write basic appenders, and another day to write your own appender for this problem. Compare that to the effort of writing something to poll a log file, re-read it constantly and update another file, operations which will get slower and slower as they go along. That's a fair amount more code than a single appender would be. There's how to sell it to your company.
    Can you give me a brief overview in how it works?Log4J uses objects called appenders, which take logging info - generated by your container - and do something with it. It ships with some appenders already in it, for writing to stdout, files, sockets and databases. You can also write your own appenders that do something more than these standard ones do. You write logging code in your application - in this case, your container already does this so you don't have to - and the configuration of Log4J decides what happens to these logging messages. That's what you're interested in. You could write an appender - a simple class - that takes raw logging messages in, and writes them out to file in whatever format you want
    Come to think of it, depending on how complex the required XML is, you may even be able to do this without writing any code at all. You can write formatting patterns in the Log4J config that existing file appenders will use to write your XML files
    A bit of an abstract explanation, I guess. Your best bet is to first ascertain that Log4J is indeed in use, and then read the documentation, which is surprisingly good for an Apache project :-)
    [http://logging.apache.org/log4j/1.2/index.html]

  • Reading log file and calculating time between

    If someone could help me with this one, I would be very grateful.
    I have a log file and I need to search a string that contains a start time and end time (eg. <time="11:10:58.000+000">). When I have these two values, I need to measure the time that has been elapsed between these two (from start to end).

    $Path="C:\Times.log"
    remove-item $Path
    Add-Content $Path '<time="11:10:58.000+000">'
    Add-Content $Path '<time="12:10:58.000+000">'
    Add-Content $Path '<time="13:10:58.000+000">'
    Add-Content $Path '<time="15:13:38.000+000">'
    Add-Content $Path '<time="16:10:58.000+000">'
    Add-Content $Path '<time="17:08:28.000+000">'
    $File=Get-Content $Path
    $StartTime=$Null
    $EndTime=$Null
    $ElapsedTime = $Null
    ForEach ($Line in $File)
    If ($Line.Contains("time="))
    $Position = $Line.IndexOf("time=")
    $TimeStr =$Line.SubString($Position+6,8)
    IF ($StartTime -EQ $Null)
    $StartTime = $TimeStr -As [System.TimeSpan]
    Else
    $EndTime = $TimeStr -As [System.TimeSpan]
    $ElapsedTime = $EndTime.Subtract($StartTime)
    "StartTime=$StartTime EndTime=$EndTime ElapsedTime=$ElapsedTime"
    $StartTime = $Null
    Gives this output
    StartTime=11:10:58 EndTime=12:10:58 ElapsedTime=01:00:00
    StartTime=13:10:58 EndTime=15:13:38 ElapsedTime=02:02:40
    StartTime=16:10:58 EndTime=17:08:28 ElapsedTime=00:57:30

  • Essbase 7.1 - trouble reading log files

    We have recently upgraded to Essbase 7.1 We have the DELIMITEDMSG TRUE entry in our essbase.cfg file. Since the upgrade to 7.1 the log files for each application no longer have a CR/LF at the end of each entry. They are just run together into an extremely long line. However, when we look at the application window on the Essbase server the messages appear on separate lines. Has anyone else run into this problem? Is there a new essbase.cfg setting that we need to use? We take the log file for each application and load it into a logfile cube each month and this becomes very difficult if each message is not on it's own line in the file. Any help would be appreciated.

    I know that in ASO, each parent should have at least one child that aggregate with +.Did you make sure that the members properties are OK (i.e. not all children at ~) ?Not respecting this prevent from saving the Outline.If you want to keep ~ for all children, then the parent should be Label Only.I hope this helps.Denis

  • SPAU error reading log file

    Hi All,
    We have an R/3 4.0B landscape and are working on some changes.  I want to see if any SAP delivered objects have been modified in the past, but whenever I run SPAU or SPDD, I get an error message
    "Error Reading File D:\usr\sap\put\log\umodstat.log"  "Message Number 0U 503".
    I can read a text file in the same directory through AL11, so I'm reasonably sure it's not an OS permission problem.
    Any ideas?
    Thanks,
    Alan

    Hi All,
    I had same issue trying to edit sat.trc file, I fixed this problem by manual editing sat.trc file and modified the following line:
    <!FORMATTER[com.sap.tc.logging.perf.PerfFormatter]/>
    change to:
    <!FORMATTER[com.sap.tc.logging.ListFormatter]/>
    after changes you will able to open file with Visaul Admin Log Viewer or standalone logviewer.
    Hope it helps.
    Regards

  • Can't read log files from /var/log with Geany

    With the few exeptions like hibernate.log, I can't read most of those files, including:
    everything.log
    errors.log
    kernel.log
    messages.log
    syslog.log
    When I try to open them (as root), all I get is
    The file xxx.log does not look like a text file or the file encoding is not supported.
    However, they do open with nano
    Last edited by Lockheed (2013-06-20 14:20:11)

    If you want to only view the files (I assume this since those are logs), maybe try
    $ less -M <file>
    You can navigate pretty well with it (e.g. go to a specific line).
    Edit:
    You could also try to find if there is an option in Geany that would allow you to see "non-text" files.
    Last edited by msthev (2013-06-20 18:41:27)

  • Weblogic server log files !! can i read them through HTTP using browser ?

    hi all
    i wonder if i can configure weblogic server or use a utility to read my log files in application,i need something like log file browsing in oracle webcenter content .
    any advise ?
    thanks
    Edited by: hsweiss on Jul 18, 2012 9:28 AM

    Hi,
    I believe you can read log files using admin console. Go to Diagnostic--> logs and select the server which logs you want to see.
    Regards,
    Shashi

  • Reading text file to table

    Hi,
    I'm using oracle 9i on a server , and microsoft iis 6.0 is running on other server,
    I want to create a stored procedure, that read log file exist on iis server, and insert data on a table on oracle server.
    I want this procedure to run on daily basis, updating table content, then I will use discoverer to create reports.
    how can I do that?

    Best way to load data from text file to database is SQL*Loader.Actually in 9i the best way might be to use an External Table. This is much simpler to use than SQL*Loader because we can just issue a SELECT statement to get the data. SQL*loader is really only necessary when we have huge amounts of data and perfomance is critical.
    Cheers, APC

  • How to convert Labview log file to text file?

    I want to open the log file in Excel or other text editor. Is there any special format of Labview log file? I thought it just binary, so I used a general program to convert binary file to Ascii file. But it failed because of the format of the log file format. Is there any other way that I can read log file in Excel? Thanks a lot.

    Dennis Knutson wrote:
    Are you refering to the front panel logging option? The actual binary format is going to depend on what controls and indicators you have on the front panel and their data types. There is an example of using the file i/o functions to read one of these files in chapter 14 of the user manual. The problem you'll have if you write a program to read a log file is that every time you add or delete a control/indicator, you'll have to rewrite your program and then you'll be unable to read older log files. You'd be better off writing your own log routines. Then you would control the binary format. There are shipping examples that you can look at for fbinary file storage.
    Yes, I am referring the front panel logging option and I will read the maual first. Thank you very much for your help.

  • Help on Reading and Reporting From A log File

    Hi there
    I need any assistance on developing a class that is able to read from a log file and then be filtered and put into a report. I need to be able to search on the log files per criteria.

    Chainsaw:
    http://logging.apache.org/log4j/docs/chainsaw.html

  • How to read Skype connection logs (.log files in /...

    Hi all,
    A funny problem but really important - please help!
    I set up logging to find out causes of some tech problems occuring during my calls, as it described here: https://support.skype.com/en/faq/FA12321/how-do-i-create-log-files
    So, I get now /Logs folder with .log files.
    But they are not text files and I don't know what this format is and what tool can read them(
    Skype tech support doesn't know as well. Please help, who knows, how to read these .log files?
    Thanks!
    ps my OS is Ubuntu Linux

    It's somewhat odd that the Skype tech support staffer you spoke with doesn't know what to do with the logs, as the instructions you posted say to place them in a ZIP file and sent it to them. Since the log files I observed start with 'BLOGBEGIN,' there must be software to parse the file. Also...you never described the tech problems during calls which prompted you to enable logging; and if Skype Support suggested it (which seems doubtful, given they didn't know what to do with the files). Perhaps you can provide a description of the issue?

Maybe you are looking for

  • How to get photos off my iphone 4s that does not turn on

    i have nearly 2,000 photos on my iphone 4s, but my iphone just stopped working, wont turn on, i just really want the photos off thats all ive tried holding both buttons for ages and still nothing, can someone help me pls

  • ASM disks in RAC need to be shared disks?

    Hi all, sorry for the very basic question but I'm getting a lot of confusion... I have clusterware installed on node1 and node2 and I'm going to create ASM instances on both nodes. Does the ASM disks need to be physically shared among the two nodes?

  • How to fetch agent in eim 4.0 from cisco icm 7.0

    Hi, I am using eim 4.0 with ipcce 7.0. we have added some new agent in aw but that agets are not reflecting in eim user list. i have restarted the mr pg and other services but the issue is same. please let me know how to get new user created in aw in

  • Rfc user

    hello all i configure a RFC connection and a RFC user . in the logon data   , what type i need to put in the windows ? and why ? thanks for the help eyal

  • 3 Beeps when plugged in

    When I plug my sons 3G nano into the computer, i hear 3 rapid beeps and iTunes never sees the pod. My 30GB iPod and my wifes 2GB Nano connect and sync just fine. Has anyone else seen this problem, or know what the solution is? Thanks!