<?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: rex usage in splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-usage-in-splunk/m-p/192869#M55453</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prd sourcetype="nodecheck" | rex "System\s(?&amp;lt;upordown&amp;gt;\w+)" | chart count by upordown
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 18 Mar 2014 22:26:04 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-03-18T22:26:04Z</dc:date>
    <item>
      <title>rex usage in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-usage-in-splunk/m-p/192867#M55451</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
i am trying to create a pie chart with gives %age up and down time of  a system.&lt;BR /&gt;
Splunk mines a log file with the below format giving the system availability stat.&lt;BR /&gt;
If you see below, we have three status System up, down and down due to db failure.&lt;BR /&gt;
we want to combine both the downs into single category of "Down"&lt;BR /&gt;
Were using the below query in splunk to get the pie chart but the Down comes up in two different segment.&lt;BR /&gt;
index=prd sourcetype="nodecheck" | rex "System (?&lt;UPORDOWN&gt;.*)" | chart count by upordown&lt;/UPORDOWN&gt;&lt;/P&gt;

&lt;P&gt;2014-03-17 15:53:00-SystemA System Up&lt;BR /&gt;
2014-03-17 15:48:01-SystemA System Up&lt;BR /&gt;
2014-03-17 15:43:00-SystemA System Up&lt;BR /&gt;
2014-03-17 15:38:00-SystemA System Up&lt;BR /&gt;
2014-03-17 15:33:00-SystemA System Up&lt;BR /&gt;
2014-03-17 15:01:01-SystemA System Down&lt;BR /&gt;
2014-03-17 15:31:00-SystemA  System Down - Unable to connect to the Database!&lt;BR /&gt;
2014-03-17 15:21:01-SystemA  System Down - Unable to connect to the Database!&lt;BR /&gt;
2014-03-17 15:11:01-SystemA  System Down - Unable to connect to the Database!&lt;BR /&gt;
2014-03-17 15:01:01-SystemA  System Down - Unable to connect to the Database!&lt;BR /&gt;
2014-03-17 14:48:00-SystemA  System Up&lt;BR /&gt;
2014-03-17 14:43:00-SystemA  System Up&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2014 19:29:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-usage-in-splunk/m-p/192867#M55451</guid>
      <dc:creator>dutabhis07</dc:creator>
      <dc:date>2014-03-18T19:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: rex usage in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-usage-in-splunk/m-p/192868#M55452</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;rex "System (?&amp;lt;upordown&amp;gt;) .*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should provide you with just the single word following "System"&lt;/P&gt;

&lt;P&gt;To be even more flexible you could change it to&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "System\s(?&amp;lt;upordown&amp;gt;)\s.*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will ensure the word breaks happen for any whitespace character not just a space itself.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2014 19:46:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-usage-in-splunk/m-p/192868#M55452</guid>
      <dc:creator>grijhwani</dc:creator>
      <dc:date>2014-03-18T19:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: rex usage in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-usage-in-splunk/m-p/192869#M55453</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prd sourcetype="nodecheck" | rex "System\s(?&amp;lt;upordown&amp;gt;\w+)" | chart count by upordown
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Mar 2014 22:26:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-usage-in-splunk/m-p/192869#M55453</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-03-18T22:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: rex usage in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-usage-in-splunk/m-p/192870#M55454</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this search code &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prd sourcetype="nodecheck"|rex field=_raw "System\s+(?&amp;lt;SystemStatus&amp;gt;[^\$|^\!]+)"|chart count by SystemStatus
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Dec 2016 09:13:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-usage-in-splunk/m-p/192870#M55454</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2016-12-12T09:13:54Z</dc:date>
    </item>
  </channel>
</rss>

