Analyze the file of text file

Hello

I read the Apache error log using the external table.

For this reason I created the directory APACHE_LOG and grant read on it for my schema permission.
Then the external table
CREATE TABLE EXT_APACHE_ERROR_LOG
  (
    "TEXT" VARCHAR2(2000 BYTE)
  )
  ORGANIZATION EXTERNAL
  (
    TYPE ORACLE_LOADER DEFAULT DIRECTORY "APACHE_LOG" ACCESS PARAMETERS ( records delimited BY newline nobadfile nodiscardfile nologfile ) LOCATION ( "APACHE_LOG":'error.log' )
  )
  REJECT LIMIT UNLIMITED;
Log format is as below
[Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1] client denied by server configuration: /export/home/live/ap/htdocs/test
I try to read the file using the query
SELECT REGEXP_SUBSTR(text, '[^\[]+(.*?)')      AS mesg_date,
  REGEXP_SUBSTR(text, '\[([a-z]*?)\]')         AS mesg_type,
  REGEXP_SUBSTR(text, '\[client ([0-9\.]*)\]') AS client,
  REGEXP_SUBSTR(text, '\] (.*)$')              AS mesg
FROM ext_apache_error_log;
Output that is not quite what I like as I am bad with regexp.
I like to have the result in 4 columns as
MESG_DATE               MESG_TYPE     CLIENT          MESG
Wed Oct 11 14:32:52 2000     error          127.0.01     client denied by server configuration: /export/home/live/ap/htdocs/test
So I need little help
What is the best method of analysis than the format of newspaper?
Can I have these 4 columns sort already for the external table?

Thanks

Kind regards
Jari

Regexp_replace is sometimes better suited then regexP_substr.
It depends a bit on your version of DB.

It works on 10.2.0.5

with test_data as (select '[Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1] client denied by server configuration: /export/home/live/ap/htdocs/test' text from dual)
SELECT REGEXP_replace(text, '^\[(.*?)\].*$', '\1')      AS mesg_date,
  REGEXP_SUBSTR(text, '\[(.*?)\]',1,2)         AS mesg_type,
  REGEXP_SUBSTR(text, '\[(.*?)\]',1,3)         AS client,
  REGEXP_replace(text, '^(\[.*?\]\s){3}(.*)$', '\2') AS mesg
FROM test_data
;

MESG_DATE               MESG_TYPE     CLIENT          MESG
Wed Oct 11 14:32:52 2000     [error]     [client 127.0.0.1]     client denied by server configuration: /export/home/live/ap/htdocs/test

Look at the difference in the frequency of regexp_substr for the mesg_type column and client setting.
Regexp_replace makes it a little easier to remove the square brackets. 11 GR 2 it would be possible with a back reference using regexp_substr (6th parameter).

not tested because I don't have a 11g available now

  REGEXP_SUBSTR(text, '\[(.*?)\]',1,3,'c','\1')         AS client,

Published by: Sven w. on August 31, 2011 18:10

Tags: Database

Similar Questions

  • Analyze the file SDM BSOD

    Lenovo ThinkPad T440s
    Windows 7 Professional
    Intel Core i5-4300U CPU @ 1.90 GHz (4 virtual)
    8 GB RAM

    Can someone analyze this dump file and advise what is causing BSOD please

    https://onedrive.live.com/redir?RESID=68FF63851E0D73F7! 864 & authkey =! APniGzPPmMbF1Ro & ithint = the file % 2c7z

    Thank you

    GD

    Only two of these discharges came from 2016, and both had a different cause.  Run the checker to find the underlying issue

    These accidents were related to the corruption of memory (probably caused by a driver).

    Run these two tests to check your memory and find which driver is causing the problem.  Launch auditor.  You don't need to run memtest again unless the auditor is not the cause, or you want to.

    If you are overclocking anything reset by default before running these tests.
    In other words STOP! If you don't know what it means that you're probably not  


    1-Driver Verifier (for full instructions, see our wiki here)

    2-Memtest. (You can learn more about running memtest here)
  • How to analyze the files using Lexmark 2600 Series

    To the right:

    I have a Lexmark 2600 Series 3-in-1 printer. It is supposed to be able to scan. However, I can't figure out how to parse the files and I've lost the installation disc. However, the printer is already installed on my computer. I can't analyze. Can someone help me on how to scan files with this printer? Or, is there something I need to do first before that I can use the scanner fuction?

    Hi Xnygga,

    You will need to go to the Lexmark Web site to download the latest software/drivers for your scanner:

    http://support.Lexmark.com/index?page=home&locale=en&UserLocale=en_US & segment = DOWNLOAD

    I hope this helps!

    Debra
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • Satellite L670 - 11 d - AV spent hours to analyze the files called nnnnnn.exe

    I noticed that my AV has spent more than an hour in the analysis of a single folder on my L670 - 11 d.
    I had a look in the Explorer and found 96 379 files called + nnnnnnnnnn + .exe, where + n + is a decimal digit, in C:Windows\ServiceProfiles\LocalService\AppData\Loc al\Temp\.
    They were all identical apart from their name and their properties have indicated that their original name was Realtek Semiconductor RTInstal.exe.

    This model has a Realtek ethernet NIC
    The OS is W7Pro 64-bit.

    Can someone explain why I should have close to 100,000 copies of the installer, and how I can get rid of them?
    I can't imagine that I need them.

    Noel

    Hi mate

    Have no idea why you have so many temporal files on the HARD drive, but I recommend always deleting these temporal HARD disk files.
    I always do with tool called CCleaner. It s freeware tool so you can download it for free from these pages in internet.
    It cleans the HARD drive each time when starting of the OS.

  • By adding a sequential number to analyze the file name

    On my HP OJ 4500 G510g-m, when scaning using the HP solutions Center - it always adds a number to 4 digits at the end of the name of the basis file that I can change.

    That I don't seem to be able to do is to get until STOPPED by adding the number 4-digit. I never want to do. I could see where this might be useful, but not for my situation.  Looks like there should be a checkbox to enable/disable this feature.

    Everyone there knows a way to achieve... notch record or something else? It's a pain to have to edit each file name that I scan so that I can eliminate the 4-digit number.

    Oh Yes... to help to win 8 with the latest drivers and software available.

    Well, that's an answer that is not a solution.

    However, as there is no solution, I have to call it resolved as you gave it at least a response with sufficient clarity that I can stop looking for a way to do what I want.

    FWIW - in my 22 years of it works, almost every software program scanning for this, and dang some of 'EM have an option to disable it-so for all these years, I've been editing file names to remove the 0001 that someone think everyone wants. I never talked to anyone who does not want that it kind... change which ever is used for market research.

    Add a number at the end, if there is already a file with the name you specify... now it makes sense.

    It is stupid to think that is what HP (and others) did that hardcode in the scan software. Please go to the top of the line.

    I am grateful for the response, however. It is simply not a solution.

  • Unable to parse the file config.xml - bad xml structure

    I'm doing a simple application for blackberry phones.  I used the code on the site of dev on creating your first application.


    http://www.w3.org/ns/widgets ".
    "xmlns:RIM ="http://www.blackberry.com/ns/widgets"
    version = "1.0.0.0" >
      DevBlog
      BlackBerry Developer Blog
     
    email = '[email protected]' > John Doe
     
      http://devBlog.BlackBerry.com"/ >
     

    I edited it for the site we want to and other details as follows:


    http://www.w3.org/ns/widgets ".
    "xmlns:RIM ="http://www.blackberry.com/ns/widgets"
    version = "1.0.0.0" >
     
     DeVryUniversity 
     DeVry University Library 
     
    email ="[email protected]" > Danny coats "
      
     http://library.DeVry.edu/cgi-bin/Pwebrecon.cgi?DB=local&page=first"/ >
     

    It gives me the following error when I compile it:

    C:\Program Research In Motion\BlackBerry WebWorks Packager > bbwp "C:\Users\".
    Danny Coats\workspace\applications\DeVryLibrary\DeVryLibrary.zip.
    [INFO]                  Parsing of the command line options
    [INFO]                  Bbwp.properties analysis
    [INFO]                  Validation of archive application
    [INFO]                  The analysis of config.xml
    [ERROR]                 Impossible to analyze the file config.xml - bad structure XML

    I use Windows 7 Professional and the latest version of the SDK of Blackberry WebWorks.  I find nothing in the community for this to solve.

    Any suggestions will be greatly appreciated.

    I had the same error when you try your config.
    So, I try to analyse.
    I found the error is in the value of the content item, you must:

    http://library.DeVry.edu/cgi-bin/Pwebrecon.cgi?DB=local&page=first

    and should be:

    http://library.DeVry.edu/cgi-bin/Pwebrecon.cgi?DB=local & page = First

    If the special characters in the URL must be converted to their html entities.

  • Does not delete the files off the SD through FileConnection

    As part of the application that is being developed, we try to make the dynamic files.

    When you run the update code pluck us files that are up to date and try to update by deleting everything first and then download them again.  Here is the code that we strive to use

    try
                                {
                                    conn2 = (FileConnection) Connector.open("file:///SDCard/MeetApp" + filename.substring(0,(filename.length()-1)) + ".xml", Connector.READ);
    
                                                                   if (conn2.exists())
                                                                {System.out.println(conn2.fileSize());
                                                                          conn2.close();
                                                                     conn2 = (FileConnection) Connector.open("file:///SDCard/MeetApp" + filename.substring(0,(filename.length()-1)) + ".xml",Connector.READ_WRITE);
                                                                           conn2.delete();
                                                                           conn2.close();
                                                                    }else{System.out.println("No dice");}
                            }
                            catch(Exception e)
                            {
    
                            }
    

    However, the files will not erase.  I have triple checked the path names, they are correct.  However, every time that I ask him to find a file, it is said that there is not.

    Any ideas?

    I found the problem.  When I analyze the file type of an XML document, I get the word 'page' or 'active '.  There must be a space to share and across these words when they come from the XML document because they do not equate the string 'the page' unless you trim() them.  To be sure, I converted them to hashcode and now it works correctly.

  • After scanning in a file, I can't save the PDF file with a unique file name, it will only back up in its original name; Otherwise, if I save the name of the file under a new name, save it box goes outside and the file is renamed and saved. Help!

    If I analyze the file and its original name is:

    Ssrv395alm76439... and I want to rename it "background."

    If I have the rename, the file won't save. If I leave the file as it will save and I have to go to an additional folder and rename it.

    Help, it's too long. I just click on "Save as" and rename and save the document in the necessary folder at a time!

    Hi Allisonchristinele ,

    Please provide the exact point of the software & OS installed on your system. Also check if it is there any update available for the software after crossing "" help > check updates "»

    Follow this thread to reset the Acrobat preferences:- How to reset preference settings in format Acrobat.

    Like 'save' will save the changes with the file & "save under" will give the window using which can save the file to any location on the system.

    I would like to know is what is happening with some or all the files.

    Also, please try to check with the different user account to reproduce the problem.

    Kind regards

    Christian

  • The file reference does not call. upload()

    OK it's going to take a little bit to explain but stick with me:

    I have two layers in the timeline, with no keyframes (coucheUn) and the other with a picture any key for every frame in the layer (layerB).
    In coucheUn, I have the script action to declare a variable of FileReference and I also declare and attach a listener object to the file reference.
    The listener object detects the event .onSelect to the FileRefernce (this event is generated when the service. the FileReference class's browse() is called - which opens a file browser and allows you to select a file). When called onSelect listener object executes the function. upload() FileReference which analyzes the file selected to a php script that downloads the file on my server.
    Function. for the FileReference browse() is called from an image in layerB. This is where the weird stuff that happens.
    When I test the movie the first time I enter the keyframe that calls the function. browse() all download routine work and the file is downloaded successfully. If I continue to the next keyframe (using navigation controls) and then navigate back and try to repeat the download process, then the file browser opens successfully, I select the file and then nothing happens. I have problems to identify the problem, for as far as I see it is as if it does never emit the onSelect event once the file is selected, which shouldn't be the case that the function .Browse works and a file is selected successfully. This would imply the php script does not work which is just ridiculous because it is a very simple script and it works the first time.
    Everyone has ideas, if you need more just information!


    UPDATE:

    Just did some tests and I'm completely confused, it's something the onSelect event. For some reason, it is not called / is not detected by the listener object. It's just weird because he calls good the first time you enter the frame, but if you navigate back, it is not detected. I checked the listener object was still in the scope of this framework and it seems to be, so I'm completely confused. The listener object is there and listening, the event that generated the onSelect event is executed but then never detected.

    Wooops, corrected just, said an another FileReference var on the following image with the same name, changed the name and works very well. Really really stupid of me.

  • Analyze the text file javax.mail.Message

    Hello

    I have e-mail messages saved to disk in the form of text files and I'd like to load each message as a javax.mail.Message and analyzed. The reason I want to do is that I will be able to use the java mail API and I already have an analysis program that can scan the headers and the body. Is there a possible way to do this?

    Thank you

    If the emails are saved as EML file, then you can load them as MimeMessage and then easily analyze.

    Source InputStream = new FileInputStream (emlFile);
    MimeMessage message = new MimeMessage (mailSession, source);

    Complete example at http://www.rgagnon.com/javadetails/java-0458.html

  • Why the highlighting of text in a PDF document does not work after you save the file

    Why the highlighting of text in a PDF document does not work after you save the file

    What application you use to highlight?

  • How to retrieve messages from the temporary file of windows in the form of text messages

    Hello

    We have used Thunderbird on Windows 7 for almost a year. And we have been very happy with it and had no problems.

    Today, somehow it has taken during the last six weeks of the messages in our Inbox and moved them in the mailbox of Archives in a folder called '2015 '. I don't know how or why it does this.

    More important still, when I opened this file and attempted to transfer the messages to my Inbox, messages simply disappeared. I finally found them under the Windows Temp file.

    I tried to recover these messages in our Inbox, but all attempts have failed. All messages now have a text file extension. My guess is that the file type is not correct now.

    How can I get these messages restored in my Inbox?

    Thank you

    GMS

    After looking for the message objects based on my outgoing messages during the period, I finally found the missing incoming messages. They were in the Inbox of my Eudora import. I must have put there by mistake instead of the Inbox for my main account. Me dummy.

    While I am relieved to have found them, I still don't know how the Archive was created in the first place. But I don't want to give credit to some creative stepping of a cat. More probably, they hit the right keys to make it happen. I suppose a programmer of Thunderbird could know how it happened.

    Thanks to all who tried to help.

    GMS

  • I can't access some websites using Firefox. For my own site, I get "file not found". My Yahoo downloads in the form of text. No problems with browsers IE or Chrome

    I can't access some websites using Firefox. Pages say "File not found" or in the case of Yahoo and Facebook, they resemble the on-screen text files. No problems with my computer and it is not the case with my browsers IE and Chrome. Already deleted and reinstalled Firefox and it has not solved the problem

    You can also do a check of malware with some digitization programs of malicious software on the Windows computer.

    Please scan with all programs, because each program detects a different malicious program.

    All of these programs have free versions.

    Make sure that you update each program to get the latest version of their databases before scanning.

    Alternatively, you can write a check for an infection rootkit TDSSKiller.

    See also:

  • I need written instructions to use EVS to the file text

    Also understand how to find the file to look at what I have saved at a later date.

    Note that you can use the notebook build-in the current version of Firefox to edit text files.

  • I'm doing a script that takes a list of e-mail from a text file and then allow me to select a save as a string. I found some ways to get the path of the file, but I'm in check by pulling the list

    I found some ways to get the path of the file, but I am defeated by pulling the list from that. the function of the path get gives me the path as "Macintosh Users:: Documents: extractedb.txt (myUsername).

    What I can't understand is how to get a dialog box to display a list that represents the content in the text file, I need to change the contents of the text file, I need the box to show me what I chose and I want to save my selection as a single string.
    e '.

    example of extractedb.txt information:

    [email protected]

    [email protected]

    [email protected]

    * has a random number of emails as well *.

    I want this is to pull those emails from the text file and turn them into a list so I can get to be a selection in my dialog box.

    Any help would be great = D

    Assuming you have a text file with your example e-mail addresses, the following AppleScript will read this file in a list (mf_List) and then use this list as input to choose among the list. Because multiple selection is allowed (control button), the output is sent to a list (sel_addr). We check if the Cancel button was pressed by testing for false and if this condition is met, we the script error.  Based on a single or multiple list item content of the list, display accordingly.

    game of mf to ((path to the folder as text) & "mail_list.txt")

    the value mf_List to {}

    the value sel_addr to {}

    the value mf_List to paragraphs of (read file mf)

    the value sel_addr to (choose from the list mf_List with title ¬

    ('Mail list' with multiple selections allowed without empty selection allowed)

    If sel_addr is equal to false then

    Error number-128

    return

    end if

    If length of sel_addr is equal to 1 then

    sel_addr display dialog box as text

    on the other

    the value Point to the text of TID to AppleScript delimiters

    the value Point text in AppleScript return delimiters

    display the dialog box elements of sel_addr in the text

    the value Text of point AppleScript delimiters to TID

    end if

    return

Maybe you are looking for

  • anniversary health app crash

    close all other applications. Repeatable. everything is updated.

  • Loading in click - once the Application OR assembly problems

    I created an application to measure the current consumption of a device in Visual Studio 2012. I built a library for the National Instruments USB-6008 and added the dll from C:\Program Files (x 86) \National Instruments\MeasurementStudioVS2012\DotNET

  • When using OE6, I'm not able to open links in an email

    Original title: forum xp - Internet Explorer version: IE7-----When using OE6, I am was able to open links in an email, even if the cliks of mouse on the link and the link address is displayed at the bottom of page. I am able to open attachments.

  • Audio W530

    I recently got my W530 and I noticed that when I play music, the speakers on the system seem to sizzle and almost lag a bit sometimes when the sound is of about half Max usually, it crackles at the beginning of the audio file but most of the time aft

  • Microsoft Teredo Tunneling adapter, can not start correctly

    When I run my health system monthly report the resource and performance monitor told me that; A device has a configuration problem that prevents it from starting correctly. Details: The device, Microsoft Teredo Tunneling adapter, cannot start properl