<?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 use  strings values as a variable to do stats in Security</title>
    <link>https://community.splunk.com/t5/Security/use-strings-values-as-a-variable-to-do-stats/m-p/754871#M18536</link>
    <description>&lt;P&gt;index=myindex&amp;nbsp; (&amp;nbsp;"Sign-up experience experiment not allowed" OR&amp;nbsp;"Sign-up experience experiment allowed" OR&amp;nbsp;"experiments.1" )&lt;/P&gt;&lt;P&gt;SO, there are three string searches; the first tow differ in a "not" inside the text.&lt;/P&gt;&lt;P&gt;I would like to do a stats to count for the appearance of each, e.g.&lt;/P&gt;&lt;P&gt;| stats count by&amp;nbsp; &amp;lt;var&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Oct 2025 18:26:49 GMT</pubDate>
    <dc:creator>gsbpp</dc:creator>
    <dc:date>2025-10-28T18:26:49Z</dc:date>
    <item>
      <title>use  strings values as a variable to do stats</title>
      <link>https://community.splunk.com/t5/Security/use-strings-values-as-a-variable-to-do-stats/m-p/754871#M18536</link>
      <description>&lt;P&gt;index=myindex&amp;nbsp; (&amp;nbsp;"Sign-up experience experiment not allowed" OR&amp;nbsp;"Sign-up experience experiment allowed" OR&amp;nbsp;"experiments.1" )&lt;/P&gt;&lt;P&gt;SO, there are three string searches; the first tow differ in a "not" inside the text.&lt;/P&gt;&lt;P&gt;I would like to do a stats to count for the appearance of each, e.g.&lt;/P&gt;&lt;P&gt;| stats count by&amp;nbsp; &amp;lt;var&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 18:26:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/use-strings-values-as-a-variable-to-do-stats/m-p/754871#M18536</guid>
      <dc:creator>gsbpp</dc:creator>
      <dc:date>2025-10-28T18:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: use  strings values as a variable to do stats</title>
      <link>https://community.splunk.com/t5/Security/use-strings-values-as-a-variable-to-do-stats/m-p/754875#M18537</link>
      <description>&lt;P&gt;If the searched-for strings are in a known field then you can use that field in the &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex ( "Sign-up experience experiment not allowed" OR "Sign-up experience experiment allowed" OR "experiments.1" )
| stats count by foo&lt;/LI-CODE&gt;&lt;P&gt;OTOH, if the strings can be anywhere then it gets more involved.&amp;nbsp; We need to create a field for the &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command to use.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex ( "Sign-up experience experiment not allowed" OR "Sign-up experience experiment allowed" OR "experiments.1" )
| eval foo=case(searchmatch("Sign-up experience experiment not allowed"),"Not allowed", 
searchmatch("Sign-up experience experiment allowed"), "Allowed", searchmatch("experiments.1"), "Experiments",
1==1, "Other" )
| stats count by foo&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 28 Oct 2025 19:11:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/use-strings-values-as-a-variable-to-do-stats/m-p/754875#M18537</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2025-10-28T19:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: use  strings values as a variable to do stats</title>
      <link>https://community.splunk.com/t5/Security/use-strings-values-as-a-variable-to-do-stats/m-p/754907#M18538</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/224402"&gt;@gsbpp&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can try something below to match and do a stats count.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex (
"Sign-up experience experiment not allowed"
OR "Sign-up experience experiment allowed"
OR "experiments.1"
)
| eval phrase=case(
searchmatch("Sign-up experience experiment not allowed"), "Sign-up experience experiment not allowed",
searchmatch("Sign-up experience experiment allowed"), "Sign-up experience experiment allowed",
searchmatch("experiments.1"), "experiments.1"
)
| stats count by phrase&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prewin&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;If this answer helped you, please consider marking it as the solution or giving a Karma. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 06:01:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/use-strings-values-as-a-variable-to-do-stats/m-p/754907#M18538</guid>
      <dc:creator>PrewinThomas</dc:creator>
      <dc:date>2025-10-29T06:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: use  strings values as a variable to do stats</title>
      <link>https://community.splunk.com/t5/Security/use-strings-values-as-a-variable-to-do-stats/m-p/754977#M18539</link>
      <description>&lt;P&gt;It worked. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 14:51:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/use-strings-values-as-a-variable-to-do-stats/m-p/754977#M18539</guid>
      <dc:creator>gsbpp</dc:creator>
      <dc:date>2025-10-30T14:51:44Z</dc:date>
    </item>
  </channel>
</rss>

