<?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 help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705173#M238807</link>
    <description>&lt;P&gt;The thing is that regex must match your data properly so we can't just "assume" something out of the blue.&lt;/P&gt;&lt;P&gt;You can fiddle with the regex for yourself (and see how and why it works)&lt;/P&gt;&lt;P&gt;&lt;A href="https://regex101.com/r/VaY5Qn/1" target="_blank"&gt;https://regex101.com/r/VaY5Qn/1&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2024 08:21:02 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-11-25T08:21:02Z</dc:date>
    <item>
      <title>rex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705102#M238786</link>
      <description>&lt;P&gt;probably an easy one, i have two events as follows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thisisfield1 thisisfield2 mynextfield3&lt;/P&gt;&lt;P&gt;thisisfield1 mynextfield3&lt;/P&gt;&lt;P&gt;meaning in some events field2 exists, in some it doesnt, when it does i want the value and when it doesnt i want it to be blank and all records have mynextfield3 and i always want that as field3&lt;/P&gt;&lt;P&gt;i want rex these lines and end up with&lt;/P&gt;&lt;P&gt;field1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;field2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field3&lt;/P&gt;&lt;P&gt;thisisfield1&amp;nbsp; &amp;nbsp; thisisfield2&amp;nbsp; &amp;nbsp;mynextfield3&lt;/P&gt;&lt;P&gt;thisisfield1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mynextfield3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2024 13:38:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705102#M238786</guid>
      <dc:creator>darkins</dc:creator>
      <dc:date>2024-11-23T13:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: rex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705103#M238787</link>
      <description>&lt;P&gt;Assuming that field1 and field3 are always at the beginning and end of the line respectively, and assuming that their values do not contain spaces, and assuming they are separated by spaces, you could use this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;^(?&amp;lt;field1&amp;gt;\S+)\s*(?&amp;lt;field2&amp;gt;\S+)?\s(?&amp;lt;field3&amp;gt;\S+)$&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2024 13:49:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705103#M238787</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2024-11-23T13:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: rex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705132#M238794</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/272768"&gt;@darkins&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;could you share some samples of your logs, highlighting the strings to extract?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2024 09:17:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705132#M238794</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-11-24T09:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: rex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705142#M238796</link>
      <description>&lt;P&gt;It all depends how your fields are delimited/anchored. &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263556"&gt;@marnall&lt;/a&gt; 's answer is obvious if you have just two or three words separated by spaces. If your "layout" is different, you have to adjust it.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2024 12:07:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705142#M238796</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-11-24T12:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: rex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705152#M238801</link>
      <description>&lt;P&gt;not sure what else to put, this is what my data looks like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thisisfield1 thisisfield2 mynextfield3&lt;/P&gt;&lt;P&gt;thisisfield1 mynextfield3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want these two lines to display as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;field1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;field2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/STRONG&gt; &lt;STRONG&gt;field3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;thisisfield1&amp;nbsp; &amp;nbsp; thisisfield2&amp;nbsp; &amp;nbsp;mynextfield3&lt;/P&gt;&lt;P&gt;thisisfield1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mynextfield3&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2024 23:50:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705152#M238801</guid>
      <dc:creator>darkins</dc:creator>
      <dc:date>2024-11-24T23:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: rex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705153#M238802</link>
      <description>&lt;P&gt;i guess the key is i think i need to say that field2 equals everything up to an m PRECEDED by a space?&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2024 23:54:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705153#M238802</guid>
      <dc:creator>darkins</dc:creator>
      <dc:date>2024-11-24T23:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: rex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705166#M238806</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/272768"&gt;@darkins&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;ad also&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263556"&gt;@marnall&lt;/a&gt;&amp;nbsp;said, the regex depends on the log, so it's difficoult to create a regex without some sample.&lt;/P&gt;&lt;P&gt;If you have three words, separated by a space and somethimes there are only two words without any other rule, it's not possible to define a regex; if instead there's some additional rule in the firstfields or in the nextfield, it's possible to identify a regex.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 07:29:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705166#M238806</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-11-25T07:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: rex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705173#M238807</link>
      <description>&lt;P&gt;The thing is that regex must match your data properly so we can't just "assume" something out of the blue.&lt;/P&gt;&lt;P&gt;You can fiddle with the regex for yourself (and see how and why it works)&lt;/P&gt;&lt;P&gt;&lt;A href="https://regex101.com/r/VaY5Qn/1" target="_blank"&gt;https://regex101.com/r/VaY5Qn/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 08:21:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/705173#M238807</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-11-25T08:21:02Z</dc:date>
    </item>
  </channel>
</rss>

