<?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 How to monitor 150+ instances of the same service in perfmon in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-150-instances-of-the-same-service-in-perfmon/m-p/397076#M115269</link>
    <description>&lt;P&gt;So my systems can spawn upto and above 150+ instances of the same application. I'm using the generic perfmon Process monitor: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[perfmon://Process]
counters = % Processor Time; % User Time; % Privileged Time; Virtual Bytes Peak; Virtual Bytes; Page Faults/sec; Working Set Peak; Working Set; Page File Bytes Peak; Page File Bytes; Private Bytes; Thread Count; ID Process; Pool Paged Bytes; Pool Nonpaged Bytes; Handle Count; IO Read Operations/sec; IO Write Operations/sec; IO Data Operations/sec; IO Other Operations/sec; IO Read Bytes/sec; IO Write Bytes/sec; IO Data Bytes/sec; IO Other Bytes/sec; Working Set - Private
disabled = 0
instances = myapp
interval = 1
mode = single
object = Process
useEnglishOnly=true
index = perfmon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My concern is that instances can't use wildcards in naming standards. &lt;BR /&gt;
instances = myapp* doesn't work. Only works when doing instances = * which I don't want. I could write a script that generates myapp#1,myapp#2,myapp#3 (etc.) but I'm worried that's not going to be the best way to deploy this monitor. &lt;/P&gt;

&lt;P&gt;Does anyone have any other suggestions?&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jul 2019 16:15:34 GMT</pubDate>
    <dc:creator>mmqt</dc:creator>
    <dc:date>2019-07-15T16:15:34Z</dc:date>
    <item>
      <title>How to monitor 150+ instances of the same service in perfmon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-150-instances-of-the-same-service-in-perfmon/m-p/397076#M115269</link>
      <description>&lt;P&gt;So my systems can spawn upto and above 150+ instances of the same application. I'm using the generic perfmon Process monitor: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[perfmon://Process]
counters = % Processor Time; % User Time; % Privileged Time; Virtual Bytes Peak; Virtual Bytes; Page Faults/sec; Working Set Peak; Working Set; Page File Bytes Peak; Page File Bytes; Private Bytes; Thread Count; ID Process; Pool Paged Bytes; Pool Nonpaged Bytes; Handle Count; IO Read Operations/sec; IO Write Operations/sec; IO Data Operations/sec; IO Other Operations/sec; IO Read Bytes/sec; IO Write Bytes/sec; IO Data Bytes/sec; IO Other Bytes/sec; Working Set - Private
disabled = 0
instances = myapp
interval = 1
mode = single
object = Process
useEnglishOnly=true
index = perfmon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My concern is that instances can't use wildcards in naming standards. &lt;BR /&gt;
instances = myapp* doesn't work. Only works when doing instances = * which I don't want. I could write a script that generates myapp#1,myapp#2,myapp#3 (etc.) but I'm worried that's not going to be the best way to deploy this monitor. &lt;/P&gt;

&lt;P&gt;Does anyone have any other suggestions?&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 16:15:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-150-instances-of-the-same-service-in-perfmon/m-p/397076#M115269</guid>
      <dc:creator>mmqt</dc:creator>
      <dc:date>2019-07-15T16:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to monitor 150+ instances of the same service in perfmon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-150-instances-of-the-same-service-in-perfmon/m-p/397077#M115270</link>
      <description>&lt;P&gt;If anyone stumbles into this question in the future, I wasn't able to solve the initial problem of monitoring my processes with perfmon so I setup a powershell script and a custom app, my app is configured as follows&lt;/P&gt;

&lt;P&gt;local/inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# Process Monitor script
[script://.\bin\myapp.path]
interval = 10
disabled = 0

#monitor output of proc
[monitor://$SPLUNK_HOME\var\log\myapp\proc.csv]
disabled = 0
sourcetype = myappProc
interval = 10
crcSalt = &amp;lt;SOURCE&amp;gt;
index = oswin
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;local/props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myappProc]
DATETIME_CONFIG = CURRENT
LINE_BREAKER = ([\r\n]+)
FIELD_DELIMITER = ,
FIELD_NAMES = Name,StartTime,cpu_user_percent,NPM,PM,WS(MB),WS,VM,PID,Path,user
FIELD_QUOTE = "
INDEXED_EXTRACTIONS = csv
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
category = Custom
description = myapp Process Monitor
disabled = false
pulldown_type = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;bin/myapp.path&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe -command  " &amp;amp; 'C:\Program Files\SplunkUniversalForwarder\etc\apps\myapp\bin\myappproc.ps1'"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;bin/myappproc.ps1&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$CPUPercent = @{
  Name = 'CPU'
  Expression = {
    $TotalSec = (New-TimeSpan -Start $_.StartTime).TotalSeconds
    [Math]::Round( ($_.CPU * 100 / $TotalSec), 3)
  }
}
$owners = @{}
gwmi win32_process |% {$owners[$_.handle] = $_.getowner().user}

Set-Variable -Name "LogFolder" -Value "C:\Program Files\SplunkUniversalForwarder\var\log\myapp"
Set-Variable -Name "MonitoredLogFile" -Value "C:\Program Files\SplunkUniversalForwarder\var\log\myapp\proc.csv"

if (!(Test-Path -Path $LogFolder )) {
        New-Item -ItemType directory -Path $LogFolder
}


$Processes = Get-Process |
Where-Object -property Path -like "*MYAPP*"|
 Select-Object -Property Name,StartTime, $CPUPercent,NPM,PM,{$_.WorkingSet /1mb},WS,VM,Id,Path,@{l="Owner";e={$owners[$_.id.tostring()]}} |
 Select-Object
 $output = ForEach ($Process in $Processes){
        $Process
        }
$output |ConvertTo-Csv -NoTypeInformation |Select-Object -Skip 1| Set-Content -Path $MonitoredLogFile
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps anyone who finds this. &lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 23:38:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-150-instances-of-the-same-service-in-perfmon/m-p/397077#M115270</guid>
      <dc:creator>mmqt</dc:creator>
      <dc:date>2019-07-22T23:38:08Z</dc:date>
    </item>
  </channel>
</rss>

