<?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 do I get my search to return all associated sessionIDs based on user input with values that can be in 3 different formats? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209592#M61298</link>
    <description>&lt;P&gt;It may not work if $phoneNumber$ is +14155550123 as I would like to see A,B and C in my search result if $phoneNumber$ is either 4155550123 or +14155550123 or 14155550123.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jun 2016 23:07:57 GMT</pubDate>
    <dc:creator>servlette</dc:creator>
    <dc:date>2016-06-13T23:07:57Z</dc:date>
    <item>
      <title>How do I get my search to return all associated sessionIDs based on user input with values that can be in 3 different formats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209589#M61295</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have something like the following which gets logged:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sessionId=A,phone=4155550123
sessionId=B,phone=14155550123
sessionId=C,phone=+14155550123
sessionId=D,phone=4085550123
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm trying to come up with a dashboard where I have a text field that takes a phone number as input.&lt;/P&gt;

&lt;P&gt;If user enters the phone number value as one of the following:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;4155550123&lt;/CODE&gt; or &lt;CODE&gt;14155550123&lt;/CODE&gt; or &lt;CODE&gt;+14155550123&lt;/CODE&gt;, then I want to get all the session ID's associated.&lt;/P&gt;

&lt;P&gt;In a nutshell, I have the same phone number logged in different formats and I still need to get all the session ID's associated with the given phone.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndex phone=$phoneNumber$ | table sessionId
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I replace &lt;CODE&gt;$phoneNumber$&lt;/CODE&gt; with &lt;CODE&gt;4155550123&lt;/CODE&gt; or &lt;CODE&gt;+14155550123&lt;/CODE&gt; or &lt;CODE&gt;14155550123&lt;/CODE&gt;, then I would like to A, B, and C in my search result.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 22:44:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209589#M61295</guid>
      <dc:creator>servlette</dc:creator>
      <dc:date>2016-06-13T22:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my search to return all associated sessionIDs based on user input with values that can be in 3 different formats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209590#M61296</link>
      <description>&lt;P&gt;If you have a search-time extraction (probably) then you will need to take a look at this Q&amp;amp;A and modify &lt;CODE&gt;fields.conf&lt;/CODE&gt; so it works they way you expect:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/267175/search-does-not-return-results-for-some-values-of.html"&gt;https://answers.splunk.com/answers/267175/search-does-not-return-results-for-some-values-of.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Once that is done, you should be able to do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=myIndex phone="$phoneNumber$" OR phone="1$phoneNumber$" OR phone="+1$phoneNumber$" | table sessionId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Jun 2016 22:50:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209590#M61296</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-13T22:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my search to return all associated sessionIDs based on user input with values that can be in 3 different formats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209591#M61297</link>
      <description>&lt;P&gt;Assuming that user enters the phone number as 4155550123, then it gets translated to:&lt;/P&gt;

&lt;P&gt;index=myIndex phone=4155550123 OR phone=14155550123 OR phone=+14155550123 &lt;/P&gt;

&lt;P&gt;And the search result will have A, B and C.&lt;/P&gt;

&lt;P&gt;If it is entered as +14155550123, then it will be:&lt;/P&gt;

&lt;P&gt;index=myIndex phone=+14155550123 OR phone=1+14155550123 OR Phone=+1+14155550123.&lt;/P&gt;

&lt;P&gt;I guess the search result will only have A (whereas the expectation is A, B and C).&lt;/P&gt;

&lt;P&gt;This may work only if user enters it as 4155550123 (with no country code) and it may not work for 14155550123 or +14155550123 is used for searching.&lt;/P&gt;

&lt;P&gt;What I'm interested in is that irrespective of whatever the input format is I would like to have A, B and C in my search result.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 23:02:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209591#M61297</guid>
      <dc:creator>servlette</dc:creator>
      <dc:date>2016-06-13T23:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my search to return all associated sessionIDs based on user input with values that can be in 3 different formats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209592#M61298</link>
      <description>&lt;P&gt;It may not work if $phoneNumber$ is +14155550123 as I would like to see A,B and C in my search result if $phoneNumber$ is either 4155550123 or +14155550123 or 14155550123.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 23:07:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209592#M61298</guid>
      <dc:creator>servlette</dc:creator>
      <dc:date>2016-06-13T23:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my search to return all associated sessionIDs based on user input with values that can be in 3 different formats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209593#M61299</link>
      <description>&lt;P&gt;What I did is something like this:&lt;/P&gt;

&lt;P&gt;index=myIndex | eval last10Digits=substr($phoneNumber$, len($phoneNumber$)-9, 10) | where like (phone, "%last10Digits") &lt;/P&gt;

&lt;P&gt;And it did not work.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 23:35:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209593#M61299</guid>
      <dc:creator>servlette</dc:creator>
      <dc:date>2016-06-13T23:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my search to return all associated sessionIDs based on user input with values that can be in 3 different formats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209594#M61300</link>
      <description>&lt;P&gt;index=myIndex | eval last10Digits=substr($phoneNumber$, len($phoneNumber$)-9, 10) | where like (phone, "%".last10Digits."%")&lt;/P&gt;

&lt;P&gt;This worked for me... I need to run some tests to verify...&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 23:58:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209594#M61300</guid>
      <dc:creator>servlette</dc:creator>
      <dc:date>2016-06-13T23:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my search to return all associated sessionIDs based on user input with values that can be in 3 different formats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209595#M61301</link>
      <description>&lt;P&gt;I gave you an answer that works &lt;EM&gt;efficiently&lt;/EM&gt; by operating on metadata.  You can work with &lt;CODE&gt;eval&lt;/CODE&gt; and other post-pipe commands (e.g. &lt;CODE&gt;regex&lt;/CODE&gt; ) but your search efficiency will suffer (which may or may not be important to you).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndex | regex phone="4155550123$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jun 2016 15:41:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-my-search-to-return-all-associated-sessionIDs-based/m-p/209595#M61301</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-14T15:41:50Z</dc:date>
    </item>
  </channel>
</rss>

