<?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 edit ps.sh to limit process getting in ingest for Splunk Add-on for Unix and Linux in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-ps-sh-to-limit-process-getting-in-ingest-for-Splunk/m-p/423101#M94215</link>
    <description>&lt;P&gt;Hello, &lt;BR /&gt;
I'm trying to only get a certain server processes to ingest to splunk index using Splunk Add-on for Unix and Linux script by editing the ps.sh script by adding grep command in there. like below. &lt;BR /&gt;
However i'm getting error like &lt;BR /&gt;
ERROR: Unsupported option (BSD syntax)&lt;BR /&gt;
or&lt;BR /&gt;
ERROR: Garbage option.&lt;/P&gt;

&lt;P&gt;edit:&lt;BR /&gt;
CMD='ps auxww|grep nc'&lt;/P&gt;

&lt;P&gt;Could someone please direct me to document how to add grep in or some guidance how to get this ps.sh script to works?&lt;/P&gt;

&lt;P&gt;thank you &lt;/P&gt;</description>
    <pubDate>Tue, 21 Aug 2018 20:01:17 GMT</pubDate>
    <dc:creator>tgmvt03</dc:creator>
    <dc:date>2018-08-21T20:01:17Z</dc:date>
    <item>
      <title>How to edit ps.sh to limit process getting in ingest for Splunk Add-on for Unix and Linux</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-ps-sh-to-limit-process-getting-in-ingest-for-Splunk/m-p/423101#M94215</link>
      <description>&lt;P&gt;Hello, &lt;BR /&gt;
I'm trying to only get a certain server processes to ingest to splunk index using Splunk Add-on for Unix and Linux script by editing the ps.sh script by adding grep command in there. like below. &lt;BR /&gt;
However i'm getting error like &lt;BR /&gt;
ERROR: Unsupported option (BSD syntax)&lt;BR /&gt;
or&lt;BR /&gt;
ERROR: Garbage option.&lt;/P&gt;

&lt;P&gt;edit:&lt;BR /&gt;
CMD='ps auxww|grep nc'&lt;/P&gt;

&lt;P&gt;Could someone please direct me to document how to add grep in or some guidance how to get this ps.sh script to works?&lt;/P&gt;

&lt;P&gt;thank you &lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 20:01:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-ps-sh-to-limit-process-getting-in-ingest-for-Splunk/m-p/423101#M94215</guid>
      <dc:creator>tgmvt03</dc:creator>
      <dc:date>2018-08-21T20:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit ps.sh to limit process getting in ingest for Splunk Add-on for Unix and Linux</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-ps-sh-to-limit-process-getting-in-ingest-for-Splunk/m-p/423102#M94216</link>
      <description>&lt;P&gt;@tgmvt03 ,&lt;/P&gt;

&lt;P&gt;Depending on your OS version, you could add the list of commands (process names) to be displayed using &lt;CODE&gt;-C&lt;/CODE&gt;.  Grep will remove the headers also which is used in final output&lt;/P&gt;

&lt;P&gt;For e.g. for common Linux version, change the command &lt;/P&gt;

&lt;P&gt;from&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CMD='ps -wweo uname,pid,psr,pcpu,cputime,pmem,rsz,vsz,tty,s,etime,args'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CMD='ps -wwo uname,pid,psr,pcpu,cputime,pmem,rsz,vsz,tty,s,etime,args -C splunkd'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Two main differences : &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Removed &lt;CODE&gt;e&lt;/CODE&gt; from the command which is for selecting all processes.&lt;/LI&gt;
&lt;LI&gt;Added &lt;CODE&gt;-C&lt;/CODE&gt; with the command list - here for example &lt;CODE&gt;splunkd&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Have a look at &lt;A href="http://linuxcommand.org/lc3_man_pages/ps1.html"&gt;ps man page&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 03:44:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-ps-sh-to-limit-process-getting-in-ingest-for-Splunk/m-p/423102#M94216</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-08-22T03:44:47Z</dc:date>
    </item>
  </channel>
</rss>

