<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Parsing dfm report -F perl in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Parsing-dfm-report-F-perl/m-p/50055#M10289</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your post is now more than 15 month old, but still unanswered.&lt;/P&gt;&lt;P&gt;I faced the exact same problem recently and thought I'll share the solution as soon as I found it.&lt;/P&gt;&lt;P&gt;Maybe it still helps you or at least others who want to directly process the dfm perl output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the "eval()" function and run the command as argument (don't forget the backticks)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;eval(`dfm database query run -F perl "SELECT * FROM objectview"`);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will force your perl script to interpret the output of the dfm command as actual perl code and execute it.&lt;/P&gt;&lt;P&gt;Afterwards you'll have the hashes "&lt;STRONG&gt;@queryColumns&lt;/STRONG&gt;" and "&lt;STRONG&gt;@queryData&lt;/STRONG&gt;" directly available within the initial script.&lt;/P&gt;&lt;P&gt;You may have to define the hashes first so that they are known to the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works for all dfm commands where the output can be formatted as "perl".&lt;/P&gt;&lt;P&gt;I e.g. used it with the report command and data&amp;amp;colon;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;# explicitely define the following variables as they are used&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;# within the report so that the output can be processed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;my (%reportData, @reportKeys, $reportFormatVersion, $reportCommandVersion, %report, @reportColumnKeys, %reportColumns, %reportSummary);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;my $reportOutput = `dfm report view -F perl $report $resGrp`;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;eval($reportOutput) || die ("ERROR: There is no resource group with ID $resGrp \n");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards, Niels&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Oct 2012 12:43:10 GMT</pubDate>
    <dc:creator>niels</dc:creator>
    <dc:date>2012-10-08T12:43:10Z</dc:date>
    <item>
      <title>Parsing dfm report -F perl</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Parsing-dfm-report-F-perl/m-p/50051#M10287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to export some DFM data using the database:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;dfm database query run -F perl "SELECT * FROM objectview"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It returnes following datatructure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;@queryColumns = (&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 'objId',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 'objName',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 'objFullName',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 'objDescription',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 'objType',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 'objStatus',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 'objPerfStatus',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;@queryData = (&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '1',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '193.111.44.137',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '193.111.44.137',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Mgmt Station',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Normal',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Unknown',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; ], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; ....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I transfer this into a hash? I don't want to parse it as text. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:52:16 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Parsing-dfm-report-F-perl/m-p/50051#M10287</guid>
      <dc:creator>marcusgross</dc:creator>
      <dc:date>2025-06-05T06:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing dfm report -F perl</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Parsing-dfm-report-F-perl/m-p/50055#M10289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your post is now more than 15 month old, but still unanswered.&lt;/P&gt;&lt;P&gt;I faced the exact same problem recently and thought I'll share the solution as soon as I found it.&lt;/P&gt;&lt;P&gt;Maybe it still helps you or at least others who want to directly process the dfm perl output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the "eval()" function and run the command as argument (don't forget the backticks)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;eval(`dfm database query run -F perl "SELECT * FROM objectview"`);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will force your perl script to interpret the output of the dfm command as actual perl code and execute it.&lt;/P&gt;&lt;P&gt;Afterwards you'll have the hashes "&lt;STRONG&gt;@queryColumns&lt;/STRONG&gt;" and "&lt;STRONG&gt;@queryData&lt;/STRONG&gt;" directly available within the initial script.&lt;/P&gt;&lt;P&gt;You may have to define the hashes first so that they are known to the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works for all dfm commands where the output can be formatted as "perl".&lt;/P&gt;&lt;P&gt;I e.g. used it with the report command and data&amp;amp;colon;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;# explicitely define the following variables as they are used&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;# within the report so that the output can be processed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;my (%reportData, @reportKeys, $reportFormatVersion, $reportCommandVersion, %report, @reportColumnKeys, %reportColumns, %reportSummary);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;my $reportOutput = `dfm report view -F perl $report $resGrp`;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;eval($reportOutput) || die ("ERROR: There is no resource group with ID $resGrp \n");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards, Niels&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2012 12:43:10 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Parsing-dfm-report-F-perl/m-p/50055#M10289</guid>
      <dc:creator>niels</dc:creator>
      <dc:date>2012-10-08T12:43:10Z</dc:date>
    </item>
  </channel>
</rss>

