<?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: Help with REX in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-REX/m-p/30200#M177997</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;"(?i)\(ms\):(?P&amp;lt;duration&amp;gt;.+)"

(?i)             = case insensitive  
\(ms\):          = match (ms): literally
(?P&amp;lt;duration&amp;gt;.+) = match 1 or more characters and make this available in the 'duration' field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It is extremely unlikely that the rex is the bottleneck. For something that simple, the regex engine would process tens of thousands of lines a second, and probably a lot more.&lt;/P&gt;

&lt;P&gt;Put your search in the search bar.&lt;BR /&gt;
Let it run, then press the Job Inspector button (the blue one with "i" on it).&lt;/P&gt;

&lt;P&gt;You'll see what parts of the search take longest.&lt;/P&gt;

&lt;P&gt;command.rex will be listed somewhere - its likely that its a very short bar.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Feb 2013 13:04:26 GMT</pubDate>
    <dc:creator>jonuwz</dc:creator>
    <dc:date>2013-02-13T13:04:26Z</dc:date>
    <item>
      <title>Help with REX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-REX/m-p/30197#M177994</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;rex "(?i)\(ms\):(?P&amp;lt;duration&amp;gt;.+)"  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="mylog" | rex "(?i)\(ms\):(?P&amp;lt;duration&amp;gt;.+)" |  eval epochtime=_time |   sort epochtime | table epochtime,duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am unable to figure out what is happening within the rex statement above.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(ms):5.276144
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(Data in log file comes in this format).&lt;BR /&gt;
I can understand that we're trying to catch "(ms):" in the rex command through "&lt;CODE&gt;\(ms\):&lt;/CODE&gt;"&lt;BR /&gt;
but am not able to figure out the rest of it.&lt;BR /&gt;
Kindly help.&lt;/P&gt;

&lt;P&gt;This command is extremely slow in performance - would request what changes could be done to better the performance. &lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2013 09:04:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-REX/m-p/30197#M177994</guid>
      <dc:creator>1234testtest</dc:creator>
      <dc:date>2013-02-13T09:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help with REX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-REX/m-p/30198#M177995</link>
      <description>&lt;P&gt;So what you're saying is you wrote a query that you don't understand what it does? Is something not working, or is it working but you don't understand why?&lt;/P&gt;

&lt;P&gt;Also I'm not aware of any particular performance issues with &lt;CODE&gt;rex&lt;/CODE&gt; - do you mean that the performance of &lt;CODE&gt;rex&lt;/CODE&gt; itself is poor, or do you mean that the whole query with or without &lt;CODE&gt;rex&lt;/CODE&gt; is slow?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2013 09:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-REX/m-p/30198#M177995</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-02-13T09:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Help with REX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-REX/m-p/30199#M177996</link>
      <description>&lt;P&gt;To clarify - query was written by someone else who left the firm &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
1. I didnt understand what the query is doing - I'm just getting the output of time and duration (how duration is extracted and what does + symbol denote - is it adding anything/ and overall what is the segment right to rex doing. Unable to get it.&lt;BR /&gt;
2. Whole query is slow - assumption is that rex and segment next to rex are taking too much time by splunk to evalute.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2013 09:49:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-REX/m-p/30199#M177996</guid>
      <dc:creator>1234testtest</dc:creator>
      <dc:date>2013-02-13T09:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help with REX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-REX/m-p/30200#M177997</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;"(?i)\(ms\):(?P&amp;lt;duration&amp;gt;.+)"

(?i)             = case insensitive  
\(ms\):          = match (ms): literally
(?P&amp;lt;duration&amp;gt;.+) = match 1 or more characters and make this available in the 'duration' field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It is extremely unlikely that the rex is the bottleneck. For something that simple, the regex engine would process tens of thousands of lines a second, and probably a lot more.&lt;/P&gt;

&lt;P&gt;Put your search in the search bar.&lt;BR /&gt;
Let it run, then press the Job Inspector button (the blue one with "i" on it).&lt;/P&gt;

&lt;P&gt;You'll see what parts of the search take longest.&lt;/P&gt;

&lt;P&gt;command.rex will be listed somewhere - its likely that its a very short bar.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2013 13:04:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-REX/m-p/30200#M177997</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-02-13T13:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help with REX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-REX/m-p/30201#M177998</link>
      <description>&lt;P&gt;The following are the timings shown - looks like command.search also is taking time. There are 26,128 matching events.&lt;/P&gt;

&lt;P&gt;1.249 command.search &lt;BR /&gt;
0.525   command.search.typer&lt;BR /&gt;&lt;BR /&gt;
0.436   command.search.rawdata&lt;BR /&gt;
0.355   command.sort&lt;BR /&gt;
1.518   dispatch.fetch  13  -   -&lt;BR /&gt;
2.799   dispatch.preview&lt;BR /&gt;
1.514   dispatch.stream.local&lt;BR /&gt;
1.779   dispatch.timeline&lt;BR /&gt;&lt;BR /&gt;
1.173   dispatch.tmpevents&lt;BR /&gt;
0.546   startup.handoff&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2013 12:16:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-REX/m-p/30201#M177998</guid>
      <dc:creator>1234testtest</dc:creator>
      <dc:date>2013-02-14T12:16:12Z</dc:date>
    </item>
  </channel>
</rss>

