<?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: How do you get the following search to return a piece of the process status rather than the whole output of the command line? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380842#M166669</link>
    <description>&lt;P&gt;Hi SudoSplunk, It is not working, error message :-&lt;/P&gt;

&lt;P&gt;Error in 'rex' command: Encountered the following error while compiling the regex ':\s(?PROCESS_NAME\w+):': Regex: unrecognized character after (? or (?-&lt;/P&gt;</description>
    <pubDate>Fri, 16 Nov 2018 02:43:33 GMT</pubDate>
    <dc:creator>bsaujla131984</dc:creator>
    <dc:date>2018-11-16T02:43:33Z</dc:date>
    <item>
      <title>How do you get the following search to return a piece of the process status rather than the whole output of the command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380834#M166661</link>
      <description>&lt;P&gt;I have set up a query to check the status of linux/unix processes for a number of processes. However, when it displays the results, it shows the whole output of the command line instead of showing the status of process.&lt;/P&gt;

&lt;P&gt;For example, the search is to check the output of process ABCDEF. But when I run the query, it shows as below:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;://java/path/abc: ABCDEF:/export/path/...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way I can extract just the process name instead of the whole command line as output?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 05:24:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380834#M166661</guid>
      <dc:creator>bsaujla131984</dc:creator>
      <dc:date>2018-11-09T05:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the following search to return a piece of the process status rather than the whole output of the command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380835#M166662</link>
      <description>&lt;P&gt;Hi, give this a try &lt;CODE&gt;base_search | rex field=_raw "\:\s(?&amp;lt;just_process_name&amp;gt;\w+)\:" | table just_process_name&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The regex will only work with the format specified in question. If you have multiple formats of how process name appear in logs, then provide samples of all possible formats and I will help with the regex that matches all.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 13:00:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380835#M166662</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-11-09T13:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the following search to return a piece of the process status rather than the whole output of the command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380836#M166663</link>
      <description>&lt;P&gt;Thanks for your input, I tried following searches, however it is not working as expected:-&lt;/P&gt;

&lt;P&gt;Search1:- index=Unix_process host="xxxxxx" ABCDEF COMMAND=java | dedup process | rex field=_raw ":\s(? \w+):" | table ABCDEF&lt;/P&gt;

&lt;P&gt;Error:- Error in 'rex' command: Encountered the following error while compiling the regex ':\s(? \w+):': Regex: syntax error in subpattern name (missing terminator)&lt;/P&gt;

&lt;P&gt;Search 2:- index=Unix_process host="xxxxxx" ABCDEF COMMAND=java | dedup process | rex field=_raw ":\s(?ABCDEF \w+):" | table ABCDEF&lt;/P&gt;

&lt;P&gt;Error:- Error in 'rex' command: Encountered the following error while compiling the regex ':\s(?ABCDEF \w+):': Regex: unrecognized character after (? or (?-&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:02:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380836#M166663</guid>
      <dc:creator>bsaujla131984</dc:creator>
      <dc:date>2020-09-29T22:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the following search to return a piece of the process status rather than the whole output of the command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380837#M166664</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Looks like there is no name capturing group in your rex statement. A name capturing group (including &lt;CODE&gt;&amp;lt;&amp;gt;&lt;/CODE&gt; angular brackets) should be provided in order for rex to work. &lt;/P&gt;

&lt;P&gt;Regex tested &lt;A href="https://regex101.com/r/nSnt2J/1"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 14:42:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380837#M166664</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-11-12T14:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the following search to return a piece of the process status rather than the whole output of the command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380838#M166665</link>
      <description>&lt;P&gt;Can anyone assist with this please?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 03:40:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380838#M166665</guid>
      <dc:creator>bsaujla131984</dc:creator>
      <dc:date>2018-11-13T03:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the following search to return a piece of the process status rather than the whole output of the command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380839#M166666</link>
      <description>&lt;P&gt;Did you try the regex exactly as I provided. Use this search &lt;CODE&gt;index=Unix_process host="xxxxxx" ABCDEF COMMAND=java | dedup process | rex field=_raw "\:\s(?&amp;lt;just_process_name&amp;gt;\w+)\:" | table just_process_name&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 13:05:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380839#M166666</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-11-13T13:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the following search to return a piece of the process status rather than the whole output of the command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380840#M166667</link>
      <description>&lt;P&gt;For this kind of query, your fastest iteration on trying extraction language might be to get onto the Splunk Slack channel, the #regex subchannel, and ask for help there.  It looks like sudosplunk is getting you close, but some kind of problem is persisting.  They can help you down there pretty fast.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 22:21:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380840#M166667</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-11-13T22:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the following search to return a piece of the process status rather than the whole output of the command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380841#M166668</link>
      <description>&lt;P&gt;hi @bsaujla131984&lt;/P&gt;

&lt;P&gt;Did the answer below solve your problem? If so, please resolve this post by approving it! If your problem is still not solved, keep us updated so that someone else can help ya. Thanks for posting!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 21:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380841#M166668</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2018-11-14T21:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the following search to return a piece of the process status rather than the whole output of the command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380842#M166669</link>
      <description>&lt;P&gt;Hi SudoSplunk, It is not working, error message :-&lt;/P&gt;

&lt;P&gt;Error in 'rex' command: Encountered the following error while compiling the regex ':\s(?PROCESS_NAME\w+):': Regex: unrecognized character after (? or (?-&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 02:43:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380842#M166669</guid>
      <dc:creator>bsaujla131984</dc:creator>
      <dc:date>2018-11-16T02:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the following search to return a piece of the process status rather than the whole output of the command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380843#M166670</link>
      <description>&lt;P&gt;No, It did not work...&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 04:24:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380843#M166670</guid>
      <dc:creator>bsaujla131984</dc:creator>
      <dc:date>2018-11-16T04:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the following search to return a piece of the process status rather than the whole output of the command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380844#M166671</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Regex: unrecognized character after (? or (?-
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Based on above error, I think you specified a name for capture group but not in the format what regex recognizes. Put &lt;CODE&gt;PROCESS_NAME&lt;/CODE&gt; inside angular brackets.  `| rex field=_raw ":\s(?\w+):" | table PROCESS_NAME&lt;/P&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/UuUELn/1" target="_blank"&gt;Link for working regex&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:00:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380844#M166671</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2020-09-29T22:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the following search to return a piece of the process status rather than the whole output of the command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380845#M166672</link>
      <description>&lt;P&gt;I had tried in angular brackets, however it was giving error as below:-&lt;/P&gt;

&lt;P&gt;Error in 'rex' command: The regex '_raw' does not extract anything. It should specify at least one named group. Format: (?...).&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 01:32:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-the-following-search-to-return-a-piece-of-the/m-p/380845#M166672</guid>
      <dc:creator>bsaujla131984</dc:creator>
      <dc:date>2018-11-18T01:32:17Z</dc:date>
    </item>
  </channel>
</rss>

