<?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: extract field data using regex for space delimited logs in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/extract-field-data-using-regex-for-space-delimited-logs/m-p/352468#M5621</link>
    <description>&lt;P&gt;Hi cusello,&lt;/P&gt;

&lt;P&gt;Awesome ! This is exactly what I was looking for &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
I literally hate the way the logs are setup, key-value pairs make life a hell lot easier.&lt;BR /&gt;
Is there a way we can tokenize the other elements in the logs too ?&lt;BR /&gt;
That would help immensely.&lt;/P&gt;</description>
    <pubDate>Sun, 06 Aug 2017 17:18:06 GMT</pubDate>
    <dc:creator>adwaitkaley</dc:creator>
    <dc:date>2017-08-06T17:18:06Z</dc:date>
    <item>
      <title>extract field data using regex for space delimited logs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/extract-field-data-using-regex-for-space-delimited-logs/m-p/352466#M5619</link>
      <description>&lt;P&gt;Hi,  my splunk logs are in the following format :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"POST /v2/endpoint HTTP/1.0" 200 91 "http://example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" 0.029 "127.0.0.1" "some-id"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to extract the status (200 in this case) and the response time (0.029 in this case) in my splunk search ?&lt;/P&gt;

&lt;P&gt;How can I achieve this, I tried using regex's but the same delimiting fails as the data also has spaces &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Any way I can get these ?&lt;/P&gt;</description>
      <pubDate>Sat, 05 Aug 2017 21:26:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/extract-field-data-using-regex-for-space-delimited-logs/m-p/352466#M5619</guid>
      <dc:creator>adwaitkaley</dc:creator>
      <dc:date>2017-08-05T21:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: extract field data using regex for space delimited logs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/extract-field-data-using-regex-for-space-delimited-logs/m-p/352467#M5620</link>
      <description>&lt;P&gt;Hi adwaitkaley,&lt;BR /&gt;
try with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\"[^\"]*\"\s(?&amp;lt;status&amp;gt;\d+)([^\"]*\"){4}\s(?&amp;lt;response_time&amp;gt;[^ ]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or in command &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "\"[^\"]*\"\s(?&amp;lt;status&amp;gt;\d+)([^\"]*\"){4}\s(?&amp;lt;response_time&amp;gt;[^ ]*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;could you share some additional samples, probably there's some additional problem (see &lt;A href="https://regex101.com/r/yYhGra/1"&gt;https://regex101.com/r/yYhGra/1&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Sun, 06 Aug 2017 14:49:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/extract-field-data-using-regex-for-space-delimited-logs/m-p/352467#M5620</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-08-06T14:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: extract field data using regex for space delimited logs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/extract-field-data-using-regex-for-space-delimited-logs/m-p/352468#M5621</link>
      <description>&lt;P&gt;Hi cusello,&lt;/P&gt;

&lt;P&gt;Awesome ! This is exactly what I was looking for &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
I literally hate the way the logs are setup, key-value pairs make life a hell lot easier.&lt;BR /&gt;
Is there a way we can tokenize the other elements in the logs too ?&lt;BR /&gt;
That would help immensely.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Aug 2017 17:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/extract-field-data-using-regex-for-space-delimited-logs/m-p/352468#M5621</guid>
      <dc:creator>adwaitkaley</dc:creator>
      <dc:date>2017-08-06T17:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: extract field data using regex for space delimited logs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/extract-field-data-using-regex-for-space-delimited-logs/m-p/352469#M5622</link>
      <description>&lt;P&gt;Hi adwaitkaley,&lt;BR /&gt;
in the same way&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\"(?&amp;lt;field1&amp;gt;[^\"]*)"\s(?&amp;lt;status&amp;gt;\d+)\s(?&amp;lt;substatus&amp;gt;\d+)\s\"(?&amp;lt;url&amp;gt;[^\"]*)\"\s\"(?&amp;lt;client&amp;gt;[^\"]*)\"\s(?&amp;lt;response_time&amp;gt;[^ ]*)\s\"(?&amp;lt;IP&amp;gt;[^\"]*)\"\s\"(?&amp;lt;field2&amp;gt;[^\"]*)\"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;see &lt;A href="https://regex101.com/r/yYhGra/2"&gt;https://regex101.com/r/yYhGra/2&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If this answer satisfies your need, please accept it.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 07:27:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/extract-field-data-using-regex-for-space-delimited-logs/m-p/352469#M5622</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-08-07T07:27:32Z</dc:date>
    </item>
  </channel>
</rss>

