<?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: WMI Input: best practice for field values with spaces in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/WMI-Input-best-practice-for-field-values-with-spaces/m-p/519838#M87891</link>
    <description>&lt;P&gt;what you have done to extract CommandLine is correct but EXTRACT is search time field extraction so you can keep it on search head rather Indexers.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[WMI:powershell.exe]
EXTRACT-ScriptName = CommandLine=powershell.exe+\s+\-command+\s+"&amp;amp;\s+'*(?P&amp;lt;ScriptName&amp;gt;[^("|')]+)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Sep 2020 06:41:26 GMT</pubDate>
    <dc:creator>thambisetty</dc:creator>
    <dc:date>2020-09-16T06:41:26Z</dc:date>
    <item>
      <title>WMI Input: best practice for field values with spaces</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/WMI-Input-best-practice-for-field-values-with-spaces/m-p/519637#M87850</link>
      <description>&lt;P&gt;I have some powershell scripts scheduled on a windows server and want to track their memory and cpu utilization. And I do have a working solution, but I just wondered what's the best practice here.&lt;/P&gt;&lt;P&gt;So I created a WMI input for&amp;nbsp;Win32_process, which has the "CommandLine" for each powershell.exe instance, and that includes the script name.&lt;/P&gt;&lt;P&gt;But out of the box, Splunk cuts off that CommandLine field at the first space.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="feichinger_0-1600157286972.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10840iF8DEB6EDF523065E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="feichinger_0-1600157286972.png" alt="feichinger_0-1600157286972.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I guess my question is, if there are any props.conf options (or in any other configuration) to let it read that full "line" and not stop at the spaces. It seems to be clever enough to read the WMI feed in a way where it puts each field=value into one line in the _raw data.&lt;/P&gt;&lt;P&gt;The server in question has a universal forwarder installed. And that has an app with the wmi.conf in it:&lt;/P&gt;&lt;P&gt;[WMI:powershell.exe]&lt;BR /&gt;index = perfmon&lt;BR /&gt;disabled = 0&lt;BR /&gt;interval = 60&lt;BR /&gt;wql = SELECT CommandLine, ProcessId, WorkingSetSize, KernelModeTime, UserModeTime from Win32_process WHERE Name = 'powershell.exe'&lt;/P&gt;&lt;P&gt;And on the indexer, the sourcetype is configured in the props.conf like this:&lt;/P&gt;&lt;P&gt;[WMI:powershell.exe]&lt;BR /&gt;FIELDALIAS-dest_for_perfmon = host AS dest&lt;BR /&gt;FIELDALIAS-src_for_perfmon = host AS src&lt;BR /&gt;LINE_BREAKER = ([\r\n]+)&lt;BR /&gt;NO_BINARY_CHECK = true&lt;BR /&gt;category = Custom&lt;BR /&gt;disabled = false&lt;/P&gt;&lt;P&gt;In the end, my goal is to get that script name, so I just added a field extraction for that&lt;/P&gt;&lt;P&gt;EXTRACT-ScriptName = CommandLine=powershell.exe+\s+\-command+\s+"&amp;amp;\s+'*(?P&amp;lt;ScriptName&amp;gt;[^("|')]+)&lt;/P&gt;&lt;P&gt;Is that the best way of doing it?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 08:16:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/WMI-Input-best-practice-for-field-values-with-spaces/m-p/519637#M87850</guid>
      <dc:creator>feichinger</dc:creator>
      <dc:date>2020-09-15T08:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: WMI Input: best practice for field values with spaces</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/WMI-Input-best-practice-for-field-values-with-spaces/m-p/519838#M87891</link>
      <description>&lt;P&gt;what you have done to extract CommandLine is correct but EXTRACT is search time field extraction so you can keep it on search head rather Indexers.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[WMI:powershell.exe]
EXTRACT-ScriptName = CommandLine=powershell.exe+\s+\-command+\s+"&amp;amp;\s+'*(?P&amp;lt;ScriptName&amp;gt;[^("|')]+)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 06:41:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/WMI-Input-best-practice-for-field-values-with-spaces/m-p/519838#M87891</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-16T06:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: WMI Input: best practice for field values with spaces</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/WMI-Input-best-practice-for-field-values-with-spaces/m-p/519839#M87892</link>
      <description>&lt;P&gt;good to know, thanks&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 06:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/WMI-Input-best-practice-for-field-values-with-spaces/m-p/519839#M87892</guid>
      <dc:creator>feichinger</dc:creator>
      <dc:date>2020-09-16T06:51:11Z</dc:date>
    </item>
  </channel>
</rss>

