<?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 expression Puzzle in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533024#M150576</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229130"&gt;@TorbinIT&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you already extracted the&amp;nbsp;&lt;SPAN&gt;plugin_output field, you could use the following four regexes:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=plugin_output "Model\s+:\s+(?&amp;lt;Model&amp;gt;[^ ]+)"
| rex field=plugin_output "Software\s+version\s+:\s+(?&amp;lt;Software_version&amp;gt;[^ ]+)"
| rex field=plugin_output "Version\s+source\s+:\s+(?&amp;lt;Version_source&amp;gt;[^ ]+)"
| rex field=plugin_output "Fixed\s+version\s+:\s+(?&amp;lt;Fixed_version&amp;gt;[^ ]+)"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2020 16:39:50 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-12-14T16:39:50Z</dc:date>
    <item>
      <title>Rex expression Puzzle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533019#M150574</link>
      <description>&lt;P&gt;Hey, is there anyone there good with rex expressions?&lt;BR /&gt;&lt;BR /&gt;I've been given a task by my boss, to extract 4 new fields from the data in one fiend, pluginText. The data that's currently in pluginText is as follows:&lt;BR /&gt;&lt;BR /&gt;&amp;lt;plugin_output&amp;gt;&lt;BR /&gt;Model : Q6042-E&lt;BR /&gt;Software version : 5.55.1.2&lt;BR /&gt;Version source : HTTP&lt;BR /&gt;Fixed version : 6.50.1.2&lt;BR /&gt;&amp;lt;/plugin_output&amp;gt;&lt;BR /&gt;&lt;BR /&gt;I thought I'd start by just cracking one field and if I can get one, I can sort out the others from that one as a working model. So I figured I'd start with Version source, since the end result I want is for a new field "Version source" to just display 4 letters: "HTTP".&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The problem is that it's not working, what I'm trying. I thought THIS might work:&lt;BR /&gt;&lt;BR /&gt;| rex field=pluginID "(?&amp;lt;Version source&amp;gt;\w\w\w\w)"&lt;BR /&gt;&lt;BR /&gt;but it's just giving me an error&amp;nbsp;“Regex: syntax error in subpattern name (missing terminator)”&lt;BR /&gt;&lt;BR /&gt;What am I doing wrong? I'm newbie at rex expressions and reviewing the documents Splunk's put out hasn't helped much.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 16:15:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533019#M150574</guid>
      <dc:creator>TorbinIT</dc:creator>
      <dc:date>2020-12-14T16:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rex expression Puzzle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533024#M150576</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229130"&gt;@TorbinIT&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you already extracted the&amp;nbsp;&lt;SPAN&gt;plugin_output field, you could use the following four regexes:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=plugin_output "Model\s+:\s+(?&amp;lt;Model&amp;gt;[^ ]+)"
| rex field=plugin_output "Software\s+version\s+:\s+(?&amp;lt;Software_version&amp;gt;[^ ]+)"
| rex field=plugin_output "Version\s+source\s+:\s+(?&amp;lt;Version_source&amp;gt;[^ ]+)"
| rex field=plugin_output "Fixed\s+version\s+:\s+(?&amp;lt;Fixed_version&amp;gt;[^ ]+)"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 16:39:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533024#M150576</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-12-14T16:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rex expression Puzzle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533026#M150577</link>
      <description>&lt;P&gt;I hadn't actually extracted a the plugin_output field. What I showed you was literally everything printed in the pluginText field,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This is useful though. How would I go about extracting plugin_output?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 16:49:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533026#M150577</guid>
      <dc:creator>TorbinIT</dc:creator>
      <dc:date>2020-12-14T16:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Rex expression Puzzle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533028#M150578</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229130"&gt;@TorbinIT&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you didn't already extracted the&amp;nbsp;&lt;SPAN&gt;plugin_output field, you have only to a little modify your regexes:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "Model\s+:\s+(?&amp;lt;Model&amp;gt;[^ ]+)"
| rex "Software\s+version\s+:\s+(?&amp;lt;Software_version&amp;gt;[^ ]+)"
| rex "Version\s+source\s+:\s+(?&amp;lt;Version_source&amp;gt;[^ ]+)"
| rex "Fixed\s+version\s+:\s+(?&amp;lt;Fixed_version&amp;gt;[^ ]+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 16:53:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533028#M150578</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-12-14T16:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rex expression Puzzle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533032#M150581</link>
      <description>&lt;P&gt;This makes SO MUCH SENSE. I was looking at it all wrong.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Looking just at "Model" as an example, you're telling Splunk to search for “Model”, then space between it (the \s+) then a : symbol, then MORE space between the : and the next bit (the \s+) which is the identifiable pattern. THEN, you specify the field you’re looking to create, which you're defining as "Software_version".&lt;BR /&gt;&lt;BR /&gt;The only part I'm not understanding still is the [^ ] at the end. Isn't that a command for "no included character"? Are you telling the search to ignore anything spaces in the field and display everything else?&lt;BR /&gt;&lt;BR /&gt;The only other thing worth noting is when i tried your solution, it gave me an output of&amp;nbsp;&lt;SPAN&gt;Q6042-E\n&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;I don't know where the \n came from&lt;/P&gt;&lt;P&gt;But this is certainly useful! Thank you so very much!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 17:03:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533032#M150581</guid>
      <dc:creator>TorbinIT</dc:creator>
      <dc:date>2020-12-14T17:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Rex expression Puzzle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533035#M150583</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229130"&gt;@TorbinIT&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;[^ ]&amp;nbsp;+ means: take all the chars until a space, it's an useful way to take all when there aren't spaces in the field values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;P.S.: karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 17:11:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/533035#M150583</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-12-14T17:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rex expression Puzzle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/536772#M151753</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I've done.&amp;nbsp; How to break out the results into individual software correctly in Splunk.&amp;nbsp; Any tips could be helpful.&amp;nbsp; Here is the regex being used for software_name and software_version.&lt;/P&gt;&lt;P&gt;| rex max_match=100 field=pluginText "\n+(?&amp;lt;software_name&amp;gt;[^[].*)\s\s\[version\s\d"&lt;BR /&gt;| rex max_match=100 field=pluginText "\s\s\[version\s(?&amp;lt;software_version&amp;gt;[^[]*.)\]"&lt;BR /&gt;| stats values(software_name) as software_name values(software_version) as software_version by dest&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="I'd extracted the text has group of pairs." style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12636iA8AB760060A9142C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tenable_PluginText.PNG" alt="I'd extracted the text has group of pairs." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;I'd extracted the text has group of pairs.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 17:49:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-expression-Puzzle/m-p/536772#M151753</guid>
      <dc:creator>youngsuh</dc:creator>
      <dc:date>2021-01-22T17:49:43Z</dc:date>
    </item>
  </channel>
</rss>

