Hye all. For example I use the following dtrace script : http://www.brendangregg.com/DTrace/opensnoop_example.txt the goal is to create an xml file containing the logs of this script. What is the procedure to follow ? For this for example 3 columns are in output...So i have to create a less 3 xml markers... Anyone could help me or give me a way ? Thanks in advance. This message posted from opensolaris.org
Brendan Gregg - Sun Microsystems
2007-Apr-10 02:32 UTC
[dtrace-discuss] Export DTrace logs in XML format
G''Day, On Mon, Apr 09, 2007 at 08:59:10AM -0700, metan wrote:> Hye all. For example I use the following dtrace script : > > http://www.brendangregg.com/DTrace/opensnoop_example.txt > > > the goal is to create an xml file containing the logs of this script. What is the procedure to follow ?The script''s complexity is for CLI option processing, the actual DTrace code that is significant is about a dozen lines. It shouldn''t take long to pick out the DTrace code you need, and write your own version. For it to output XML, you can simply print the raw XML as part of the printf() statements. It''s not as much work as it sounds, and you have full control of the output. ... If this was for permanent logging purposes, you may find Sun''s auditing facility already has this functionality (aka BSM auditing, aka SunSHIELD). It can be customised to record file open() events with similar fields to the opensnoop script, and the praudit(1M) tool has a -x option to output the audit logs in XML. Search for "Solaris Auditing" and "SunSHIELD" on docs.sun.com. no worries, Brendan -- Brendan [CA, USA]
Hi I''m not sure to understand. just use some printf and write your dtrace output in a file.xml... (# dtrace -q -s example.d > ***.xml) ex:example.d: dtrace:::BEGIN { printf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); printf("<?xml-stylesheet type=\"text/xsl\" href=\"example.xsl\"?>\n"); printf("<root>\n"); ..... ..... ..... dtrace:::END { printf("</root>\n"); } This message posted from opensolaris.org