<?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: Can you help me with my field extractions? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-field-extractions/m-p/408200#M117847</link>
    <description>&lt;P&gt;This rex expression works for me&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval log1="14:13:00,777 DEBUG"| appendpipe[|eval log1="2019-01-17 14:03:02,013 INFO"]|rex field=log1 "^(\S+\s+){1,3}(?&amp;lt;loglevel&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 17 Jan 2019 20:49:11 GMT</pubDate>
    <dc:creator>Vijeta</dc:creator>
    <dc:date>2019-01-17T20:49:11Z</dc:date>
    <item>
      <title>Can you help me with my field extractions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-field-extractions/m-p/408199#M117846</link>
      <description>&lt;P&gt;I have logs from the same source type called log4j in Splunk. The format for the logs is a little different. For example the log formats for data and loglevel are as follows&lt;/P&gt;

&lt;P&gt;Log 1 ---- "14:13:00,777 DEBUG"&lt;BR /&gt;
Log 2 ---- "2019-01-17 14:03:02,013 INFO"&lt;/P&gt;

&lt;P&gt;I extracted the field 'loglevel' by adding an entry \s+(?P loglevel [^ ]+)\s from console to the source type and it works perfectly for the example in log 1. However, it doesn't work for Log 2 because of the date, and it considers the time(14:03:02,013) as the log level. &lt;/P&gt;

&lt;P&gt;Please advise about what entry should be added to have the loglevel extracted for both the examples.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 20:19:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-field-extractions/m-p/408199#M117846</guid>
      <dc:creator>pdantuuri0411</dc:creator>
      <dc:date>2019-01-17T20:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my field extractions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-field-extractions/m-p/408200#M117847</link>
      <description>&lt;P&gt;This rex expression works for me&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval log1="14:13:00,777 DEBUG"| appendpipe[|eval log1="2019-01-17 14:03:02,013 INFO"]|rex field=log1 "^(\S+\s+){1,3}(?&amp;lt;loglevel&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jan 2019 20:49:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-field-extractions/m-p/408200#M117847</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-01-17T20:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my field extractions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-field-extractions/m-p/408201#M117848</link>
      <description>&lt;P&gt;@Vijeta, appreciate the quick response. &lt;/P&gt;

&lt;P&gt;As I mentioned in my question, the only option I have is to add a field(eg - \s+(?P[^ ]+)\s) in the sourcetype from console. So the answer you provided doesnt work for me. I cannot add rejex.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 21:16:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-field-extractions/m-p/408201#M117848</guid>
      <dc:creator>pdantuuri0411</dc:creator>
      <dc:date>2019-01-17T21:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my field extractions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-field-extractions/m-p/408202#M117849</link>
      <description>&lt;P&gt;@pdantuuri0411 - you can try with  ^(\S+\s+){1,3}(?\S+)&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 21:24:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-field-extractions/m-p/408202#M117849</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-01-17T21:24:18Z</dc:date>
    </item>
  </channel>
</rss>

