How to convert the xml log into tabular output in Splunk - splunk

Am new to splunk and am trying to have the xml log data into splunk and create report.
I have xml data which is being fed to splunk server. below is the format of data am having
<str name=size>3.32mb</str>
I want to extract this details and have this transformed in tabular format. like below
Size | 3.32mb
I read something about xmlkv but i think it works on xml data like <size>3.32mb</size> but i am not sure how this will work for my requirement.
Could anyone please help me in understand this and also guide me to achieve this.
Thanks in advance.

Assuming that your xml data is in a field called "xml", you can extract what you want with this:
xpath outfield=name field=xml "//str/#name" | spath input=xml output=sizeval path=str | fields name, sizeval
See the splunk help about xpath and spath - the examples are good enough to guide you.

Related

how to view stats on snowflake?

I am looking for a way to visualize the stats of a table in Snowflake.
The long step is to pull a meaningful sample of the data with python and apply Pandas, but it is somewhat inefficient and unsafe to pull the data out of snowflake.
Snowflake's new interface shows these stats graphically and I would like to know if there is a way to obtain this data with query or by consulting metadata.
I need something like Pandas-profiling but without a external server. maybe snowflake store metadata/statistic about its colums. numeric, categoric
https://github.com/pandas-profiling/pandas-profiling
thank you for your advices.
You can find a lot meta information in the INFORMATION_SCHEMA.
All the views and table functions in the Snowflake INFORMATION_SCHEMA can be found here: https://docs.snowflake.com/en/sql-reference/info-schema.html
not sure if you're talking about viewing the information schema as mentioned, but if you need documentation on this whole new interface, it's called SnowSight
you can learn more there:
https://docs.snowflake.com/en/user-guide/ui-snowsight.html
cheers!
The highlight in your screenshot isn't statistics about the data in the table, but merely about the query result (which looks like a DESCRIBE TABLE query). For example, if you look at type, it simply tells you that this table has 6 VARCHAR columns, 2 timestamps, and 1 number.
What you're looking for is something that is provided by most BI tools or data catalogs. I suggest you take a look at those instead.
You could also use an independent tool, like Soda, which is open source.

Does Tableau support complex data type of hive columns and flatten it?

I am trying to create a dashboard from the data present in the Hive. The catch is the column which I want to visualize is a nested JSON type. So will tableau able to parse and flatten the JSON column and list out all possible attributes? thanks!
Unfortunately Tableau will not automatically flatten the JSON structure of the field for you, but you can manually do so.
Here is an article that explains the use of Regex within Tableau to extract pertinent information from your JSON field.
I realize this may not be the answer you were looking for, but hopefully it gets you started down the right path.
(In case it helps, Tableau does have a JSON connector in the event you are able to connect directly to your JSON as a datasource instead of embedded in your Hive connection as a complex field type.)

Storing data in a specific format using SQL?

In one of my tables,I have an attribute that i want to store in a specific format like this
NV[0-9][0-9][0-9][0-9]. Ex: NV0001.
Can anyone help me?
P/s: sorry for the bad english :P

Can you free-text search an XML file using SQL Server?

I have an XML feed of a resume. Each part of the resume is broken down into its constituent parts. For example <employment_history>, <education>, <skills>.
I am aware that I could save each section of the XML file into a database. For example columnID = employment_history | education | skills & then conduct a free text search just on those individual columns. However I would prefer not to do this because it would create duplication of data that is already contained within the XML file and may put extra strain on indexing.
Therefore I wondered if it is possible to conduct a free text search of an XML file within the <employment_history></employment_history> using SQL Server.
If so an example would be appreciated.
Are you aware that SQL Server supports columns with the data type of "XML"? These can contain an entire XML document.
You can also index these columns and you can use XQuery to perform query and data manipulation tasks on those columns.
See Designing and Implementing Semistructured Storage (Database Engine)
Querying xml by doing string searching using sql is probably going to run into a lot of trouble.
Instead, I would parse it into whatever language you're using to interact with your database and use xpath (most languages/environments have some kind of built in or popular 3rd party library) to query it.
I think you can create a function (UDF) that takes the xml text as a parameter then it fetches the data inside tag then you make the filter you want

How to display sparql query result in the formatted html table

How can I display the result of my sparql query into html table?. Any idea?
If you don't mind using XSLT, you could do a transform from the SPARQL results XML format to HTML. If you want to build the results table with Javascript, you may prefer to use the JSON results format.
Joseki includes such transformation xlst by default. I think the license is Apache so you can use it.