How to read SQL server logs (XEL) files in Java - java

I am trying to process the SQL server log file (XEL) in Java and convert into other format like JSON. I am not able to find any documentation on How to read XEL files and there are no library that can be used to read the XEL file.
Any pointers will be helpful. Thanks in advance

Indeed, I tried to search for a library to parse XEL format file in Java, but failed. I think a workaround solution to satisfy your needs may should be considered by you.
Here is some workaround solutions in my mind.
There are some tools to help parsing XEL format file, such as Log Parser 2.2 and Read-DbaXEFile function of PowerShell Module sqlcollaborative/dbatools. For Log Parser 2.2 usage, please refer to the blogs How to parse SQL Server Error Log with Log Parser 2.2 and Microsoft’s Log Parser Utility: Swell ETL. For function Read-DbaXEFile, please see its source code https://github.com/sqlcollaborative/dbatools/blob/master/functions/Read-DbaXEFile.ps1.
There is a nuget package named XELite in C#, which be cross platform library to read XEvents from XEL files or live SQL streams.
Considering for your scenario, I think you can try to the two workaround solution to parse XEL format files stored in Azure Storage first within Azure Functions in C# or PowerShell with Blob Trigger, or within Azure Data Factory with a Custom activity, to extract these data what you want for further data processing in Spark.

Related

Getting data using OAI-PMH from an insitutional repository

I'm developing an application where I've requested data from an external institution's website. They have informed me that the data will be provided by OAI-PMH.
Could someone show me some sample code in Java how data is extracted from a OAI-PMH ?
I wonder how different it is from reading and parsing XML data.
Thank you.
Warmest wishes,
Shoubhik
For a Java implementation, for example, you could use some already existent library, like XOAI with an easy to use API. There are some provided samples.
To extract metadata from each Record you could use a XML Parser or a XML bind approach (JAXB). For other languages, like PHP and Perl there are also other alternatives.

How to create .mpp file in java?

I am able to create .mpx file by using mpxj library in java.
I need write ( create ) .mpp file in java can any one suggest me please.
I maintain MPXJ, and the short answer to your enquiry is that, at present, MPXJ does not write MPP files.
The main reason for this is simply that despite the effort which has gone into understanding the MPP file structure, there is still a great deal of it which is not well understood, hence it is difficult to reliably generate. The other issue is that even if I was to produce some code which could generate an MPP file, the features it could write to that file are likely to lag behind what MPXJ supports in the MSPDI file format, again due to my incomplete understanding of the MPP format.
My suspicion is that the next version of MS project (project 15? Project 2013?) may probably offer a ".mppx" file format, similar to the ".docx" etc formats used by other applications in the MS Office suite. This will be XML-based and will be more straightforward to generate than the binary MPP file format currently is... let's see what Microsoft come up with!
Jon
Visit http://www.mpxj.org/faq/
Can I use MPXJ to write MPP files?
Not at present. Although it is technically feasible to generate an MPP file, the knowledge we have of the file structure is still relatively incomplete, despite the amount of data we are able to correctly extract. It is therefore likely to take a considerable amount of development effort to make this work, and it is conceivable that we will not be ablet to write the full set of attributes that MPXJ supports back into the MPP file - simply because we don't understand the format well enough. You are therefore probably better off using MSPDI which does support the full range of data items present in an MPP file.
You can
Try this: http://www.aspose.com/java/project-management-component.aspx
It writes MPP and Microsoft Project XML.
But this not free
Try this: http://www.aspose.com/java/project-management-component.aspx
It writes MPP and Microsoft Project XML.
I think by "mpp" you probably mean "Microsoft PowerPoint", correct?
Q: Why do you think MPXJ (Microsoft Project Exchange/Java) can't do this?
http://www.mpxj.org/
Welcome to MPXJ! This library provides a set of facilities to allow
project information to be manipulated in Java and .Net. MPXJ supports
a range of data formats: Microsoft Project Exchange (MPX), Microsoft
Project (MPP,MPT), Microsoft Project Data Interchange (MSPDI XML),
Microsoft Project Database (MPD), Planner (XML), Primavera (PM XML,
XER, and database), and Asta Powerproject (PP, MDB).

Fast and easy data import tools/libraries

I'm looking tools/libraries which allows fast (easy) data import to existing database tables. For example phpmyadmin allows data import from .csv, .xml etc. In Hadoop hue via Beesvax for Hive we can create table from file. I'm looking tools which I can use with postgresql or libraries which allows doing such things fast and easily - I'm looking for way to avoid coding it manualy from reading file to inserting to db via jdbc.
You can do all that with standard tools in PostgreSQL, without additional libraries.
For .csv files you can use the built in COPY command. COPY is fast and simple. The source file has to lie on the same machine as the database for that. If not, you can use the very similar \copy meta-command of psql.
For .xml files (or any format really) you can use the built in pg_read_file() inside a plpgsql function. However, I quote:
Only files within the database cluster directory and the log_directory
can be accessed.
So you have to put your source file there or create a symbolic link to your actual file/directory. Then you can parse it with unnest() and xpath() and friends. You need at least PostgreSQL 8.4 for that.
A kick start on parsing XML in this blog post by Scott Bailey.

Parsing .wab Microsoft Outlook Address Book files in java

I am attempting to parse .wab files using java. Upon inspection the files look encoded because when you open them in note it just looks like garbage. The only way I have found to parse this data is to actually import it using Microsoft Outlook.
Is there an API that can be used in java to parse out this data? Or does anyone know how to go about parsing a .wab file?
Using COM from Java in combination with this free (LGPL) component http://www.nektra.com/products/nktwab-outlook-express-windows-mail-wab-api/ should allow for doing what you ask...
Another option is to use libwab from Java - see http://www.filewut.com/spages/page.php/software/libwab

Is there any way dump an IBM Rational Synergy Database through Java?

I was wondering if an API exist that would allow me to dump a synergy database through java. I can create an excel report through IBM Rational Change but it would be nice if there was a way to just send a CCMDB query to the server through java and generate a CSV or XML file and have it dumped locally. Any body know of a possible way to do that?
I would doubt that something exists publicly. You can always call a command line ccm query from java and parse the output. I am working on a Python script that will do something similar, but it will be highly specific to my project DB setup (which is a mess).

Categories