<?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: How to right regular expression for finding field value app=Center realm. ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129643#M184511</link>
    <description>&lt;P&gt;then post a sample event of the result&lt;/P&gt;</description>
    <pubDate>Wed, 08 Apr 2015 08:36:55 GMT</pubDate>
    <dc:creator>tachifelix</dc:creator>
    <dc:date>2015-04-08T08:36:55Z</dc:date>
    <item>
      <title>How to right regular expression for finding field value app=Center realm. ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129640#M184508</link>
      <description>&lt;P&gt;Hi when i searched with the below query&lt;/P&gt;

&lt;P&gt;index=casm_prod sourcetype=smtrace ........REGULAR EXP.....................&lt;/P&gt;

&lt;P&gt;Please help me to right regular expression for finding the application value app=Center realm&lt;/P&gt;

&lt;P&gt;By default it is not showing exanmple  index=casm_prod sourcetype=smtrace  app=Center realm&lt;/P&gt;

&lt;P&gt;so we need to right regular expression to show the result &lt;/P&gt;

&lt;P&gt;kindly help on it&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 15:23:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129640#M184508</guid>
      <dc:creator>moiezuddin</dc:creator>
      <dc:date>2015-04-07T15:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to right regular expression for finding field value app=Center realm. ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129641#M184509</link>
      <description>&lt;P&gt;Please post some sample data.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 15:59:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129641#M184509</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-04-07T15:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to right regular expression for finding field value app=Center realm. ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129642#M184510</link>
      <description>&lt;P&gt;to make sure that app=center realm in your data run this search :  index=casm_prod sourcetype=smtrace |search "Center realm"&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 08:30:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129642#M184510</guid>
      <dc:creator>tachifelix</dc:creator>
      <dc:date>2015-04-08T08:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to right regular expression for finding field value app=Center realm. ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129643#M184511</link>
      <description>&lt;P&gt;then post a sample event of the result&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 08:36:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129643#M184511</guid>
      <dc:creator>tachifelix</dc:creator>
      <dc:date>2015-04-08T08:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to right regular expression for finding field value app=Center realm. ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129644#M184512</link>
      <description>&lt;P&gt;moiezuddin, I am not sure I'm interpreting the request, but I see two possibilities.&lt;/P&gt;

&lt;P&gt;1) "Center realm" &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;we can see that "Center realm" is definitely in at least some search results given your posts/replies to tachifelix.  If you need to filter only on those, there is no harm in avoiding the "app=" portion and just searching for "Center realm" as your search string (in other words use &lt;CODE&gt;index=casm_prod sourcetype=smtrace "Center realm"&lt;/CODE&gt; instead of &lt;CODE&gt;index=casm_prod sourcetype=smtrace app="Center realm"&lt;/CODE&gt;)&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;But I don't think that's what you are after.  I think instead, you want:&lt;/P&gt;

&lt;P&gt;2) app="Center realm"&lt;/P&gt;

&lt;P&gt;I think you are trying to "define" app to be "center realm" when it's like the second set of logs.  For this, you'll want to create a field extraction.  You give a line format like so: &lt;CODE&gt;[04/08/2015][06:13:13.893][498011056][s46597300/r12][Center realm]...&lt;/CODE&gt;.  Now, I'm no wizard, but you could brute force something like creating a field out of the 4th set of "stuff" in square brackets (starts at index 0, not 1, hence 4th, not 5th).  There are regex ways to do it, too.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=casm_prod sourcetype=smtrace  
| makemv tokenizer="\[(.*?)\]" _raw
| eval app=mvindex(mystring,4)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now, I'm not sure how that work given your other search results, but if it's like most things in Splunk the above commands will ignore lines that don't fit the [stuff1][stuff2],... format of these lines.  I'm also not positive I have it all right, you may need the 3rd, 5th, or some other field out of that.&lt;/P&gt;

&lt;P&gt;That should let "app=blah" work fine when it's in the url string (where splunk already knows this field) and when the line matches the format of the set you gave above, then it should add app="Center realm" as a field.  &lt;/P&gt;

&lt;P&gt;Give that a try and see how it goes.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 17:25:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129644#M184512</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2015-04-08T17:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to right regular expression for finding field value app=Center realm. ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129645#M184513</link>
      <description>&lt;P&gt;By the way, if you want to use the other values, I'd use a rex probably.  I'm making it up, but if you wanted to break on square brackets, something like...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=casm_prod sourcetype=smtrace | rex "\[(?&amp;lt;mydate&amp;gt;[^]]+)\]\[(?&amp;lt;mytime&amp;gt;[^]]+)\]\[(?&amp;lt;somefield1&amp;gt;[^]]+)\]\[(?&amp;lt;somefield2&amp;gt;[^]]+)\]\[(?&amp;lt;app&amp;gt;[^]]+)\]"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That you can extend it by copying/pasting each part and renaming the field.  &lt;CODE&gt;\[(?[^]]+)\]&lt;/CODE&gt; is one piece.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 17:36:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129645#M184513</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2015-04-08T17:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to right regular expression for finding field value app=Center realm. ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129646#M184514</link>
      <description>&lt;P&gt;I think the inline version of the code (the little piece) ate my angled brackets and what was inside it (right after the question mark).  You can probably figure it out.  If you have specific problems, ask again with a few sample lines and what does/is and does not/is not working.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 17:38:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129646#M184514</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2015-04-08T17:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to right regular expression for finding field value app=Center realm. ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129647#M184515</link>
      <description>&lt;P&gt;thanks rich, for your brief explanation.&lt;/P&gt;

&lt;P&gt;i got the result with the below search query &lt;/P&gt;

&lt;P&gt;index=casm_prod sourcetype=smtrace "Center realm" | bucket _time span=1m |stats count(sso_id) as eventcount by _time, sso_id&lt;/P&gt;

&lt;P&gt;thanks alot &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:27:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-right-regular-expression-for-finding-field-value-app/m-p/129647#M184515</guid>
      <dc:creator>moiezuddin</dc:creator>
      <dc:date>2020-09-28T19:27:27Z</dc:date>
    </item>
  </channel>
</rss>

