<?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: Transforming Field Value with Rex/Regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318610#M95297</link>
    <description>&lt;P&gt;Dynamic, the user puts the users values in a Text Input this way "user1 user2 user3 user4 user5 user6 (.....)" and then I work with it in the dashboard. But thanks anyway!&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2017 17:13:54 GMT</pubDate>
    <dc:creator>pamcarvalho</dc:creator>
    <dc:date>2017-10-19T17:13:54Z</dc:date>
    <item>
      <title>Transforming Field Value with Rex/Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318607#M95294</link>
      <description>&lt;P&gt;Hey!&lt;/P&gt;

&lt;P&gt;So I have this field: "user1 user2 user3 user4 user5 user6 (.....)" and I wanted it to look like "(account="user1" OR account="user2" OR account="user3" OR (.....))" without using format or append/join, but using regex/rex. Any ideas on this?&lt;/P&gt;

&lt;P&gt;PS1: the value isn't actually user*, it is a combination of letters and numbers, like uiw849tghuADIIJO34ow. &lt;/P&gt;

&lt;P&gt;Thanks in advance!!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 16:37:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318607#M95294</guid>
      <dc:creator>pamcarvalho</dc:creator>
      <dc:date>2017-10-19T16:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming Field Value with Rex/Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318608#M95295</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
These values are static or dynamic?&lt;BR /&gt;
If static or near, you can put them on a lookip and then use it to filter you search, e.g.&lt;BR /&gt;
    Your_sear h [ | inputlookup my_lookip.csv | fields account ] | table account&lt;BR /&gt;
In dynamic use a subsearch instead lookup&lt;BR /&gt;
    Your_search [ search secondary_search | dedup 0 account | fields account ] | table account&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:20:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318608#M95295</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-29T16:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming Field Value with Rex/Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318609#M95296</link>
      <description>&lt;P&gt;I think you're looking for this:&lt;BR /&gt;
&lt;CODE&gt;rex field=testfield mode=sed "s/(\w+)/account=\"&amp;amp;\"/g""&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;It works for me in this run anywhere Splunk command:&lt;BR /&gt;
&lt;CODE&gt;| stats count | eval testfield="user1 user2 user3 user4 user5 user6" | rex field=testfield mode=sed "s/(\w+)/account=\"&amp;amp;\"/g"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 17:07:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318609#M95296</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-10-19T17:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming Field Value with Rex/Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318610#M95297</link>
      <description>&lt;P&gt;Dynamic, the user puts the users values in a Text Input this way "user1 user2 user3 user4 user5 user6 (.....)" and then I work with it in the dashboard. But thanks anyway!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 17:13:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318610#M95297</guid>
      <dc:creator>pamcarvalho</dc:creator>
      <dc:date>2017-10-19T17:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming Field Value with Rex/Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318611#M95298</link>
      <description>&lt;P&gt;Yes!! That's it! Thank you!&lt;/P&gt;

&lt;P&gt;I had to change a little bit to work though:&lt;/P&gt;

&lt;P&gt;"| rex field=FormatSS mode=sed "s/(\w+)/user_id=\"&amp;amp;\" OR/" max_match=0 | nomv FormatSS | rex field=FormatSS mode=sed "s/^/(/ s/OR$/)/" max_match=0"&lt;/P&gt;

&lt;P&gt;I was extracting values from mv fields.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:20:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318611#M95298</guid>
      <dc:creator>pamcarvalho</dc:creator>
      <dc:date>2020-09-29T16:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming Field Value with Rex/Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318612#M95299</link>
      <description>&lt;P&gt;Great. Glad I could help!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 17:22:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transforming-Field-Value-with-Rex-Regex/m-p/318612#M95299</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-10-19T17:22:25Z</dc:date>
    </item>
  </channel>
</rss>

