<?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 | metadata with powershell Search-Splunk command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/metadata-with-powershell-Search-Splunk-command/m-p/380465#M111346</link>
    <description>&lt;P&gt;I am trying to run the following search, which works fine from the regular Splunk search UI, but not in the Powershell interface...&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;| metadata type=hosts earliest=-1d&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Using the Search_Splunk command I get...&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Error in 'metadata' command: This command must be the first command of a search&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;If I remove the &lt;STRONG&gt;&lt;EM&gt;|&lt;/EM&gt;&lt;/STRONG&gt; the script completes without error but no data is returned, unlike in the UI where I get 600+ records.&lt;/P&gt;

&lt;P&gt;Any clue as to what I am doing wrong?  Greatly appreciate any assistance you can provide.&lt;/P&gt;

&lt;P&gt;Thanks, Dan&lt;/P&gt;</description>
    <pubDate>Thu, 08 Nov 2018 20:24:37 GMT</pubDate>
    <dc:creator>dchallis2017</dc:creator>
    <dc:date>2018-11-08T20:24:37Z</dc:date>
    <item>
      <title>| metadata with powershell Search-Splunk command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/metadata-with-powershell-Search-Splunk-command/m-p/380465#M111346</link>
      <description>&lt;P&gt;I am trying to run the following search, which works fine from the regular Splunk search UI, but not in the Powershell interface...&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;| metadata type=hosts earliest=-1d&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Using the Search_Splunk command I get...&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Error in 'metadata' command: This command must be the first command of a search&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;If I remove the &lt;STRONG&gt;&lt;EM&gt;|&lt;/EM&gt;&lt;/STRONG&gt; the script completes without error but no data is returned, unlike in the UI where I get 600+ records.&lt;/P&gt;

&lt;P&gt;Any clue as to what I am doing wrong?  Greatly appreciate any assistance you can provide.&lt;/P&gt;

&lt;P&gt;Thanks, Dan&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 20:24:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/metadata-with-powershell-Search-Splunk-command/m-p/380465#M111346</guid>
      <dc:creator>dchallis2017</dc:creator>
      <dc:date>2018-11-08T20:24:37Z</dc:date>
    </item>
  </channel>
</rss>

