<?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 Index substring match from inputlookup? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Index-substring-match-from-inputlookup/m-p/753666#M242768</link>
    <description>&lt;P&gt;Good afternoon.&lt;BR /&gt;&lt;BR /&gt;I have been working on this issue for a couple of days, and I just cannot seem to get this SPL correct.&lt;BR /&gt;&lt;BR /&gt;I am running a report on SIP traffic for a specific scenario, and the results of that report are written to an outputlookup (CSV) file.&amp;nbsp; I then am trying to use that CSV file in a new report to try to find any history of the phone numbers found in the first report.&lt;BR /&gt;&lt;BR /&gt;I have successfully extracted the user-part of the SIP URI (the phone number), and when I look at the results of just that SPL, everything looks good.&amp;nbsp; My problem comes from extracting that data as part of a subsearch, so that I can use the user-part as a means of finding all SIP URIs for that phone number for a period of time.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I know that phonenumber will never equal SIPURI, so I am using "| eval SIPURI = user-part."%" in the subsearch to make the subsearch a LIKE rather than an EQUALS comparison.&amp;nbsp; I am still not getting any matching events, though.&lt;BR /&gt;&lt;BR /&gt;Can someone tell me the proper way to, effectively, do a substring search with results of a subsearch, to find events in the index which contain said substring?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
    <pubDate>Fri, 26 Sep 2025 16:56:43 GMT</pubDate>
    <dc:creator>sarge338</dc:creator>
    <dc:date>2025-09-26T16:56:43Z</dc:date>
    <item>
      <title>Index substring match from inputlookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-substring-match-from-inputlookup/m-p/753666#M242768</link>
      <description>&lt;P&gt;Good afternoon.&lt;BR /&gt;&lt;BR /&gt;I have been working on this issue for a couple of days, and I just cannot seem to get this SPL correct.&lt;BR /&gt;&lt;BR /&gt;I am running a report on SIP traffic for a specific scenario, and the results of that report are written to an outputlookup (CSV) file.&amp;nbsp; I then am trying to use that CSV file in a new report to try to find any history of the phone numbers found in the first report.&lt;BR /&gt;&lt;BR /&gt;I have successfully extracted the user-part of the SIP URI (the phone number), and when I look at the results of just that SPL, everything looks good.&amp;nbsp; My problem comes from extracting that data as part of a subsearch, so that I can use the user-part as a means of finding all SIP URIs for that phone number for a period of time.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I know that phonenumber will never equal SIPURI, so I am using "| eval SIPURI = user-part."%" in the subsearch to make the subsearch a LIKE rather than an EQUALS comparison.&amp;nbsp; I am still not getting any matching events, though.&lt;BR /&gt;&lt;BR /&gt;Can someone tell me the proper way to, effectively, do a substring search with results of a subsearch, to find events in the index which contain said substring?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2025 16:56:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-substring-match-from-inputlookup/m-p/753666#M242768</guid>
      <dc:creator>sarge338</dc:creator>
      <dc:date>2025-09-26T16:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Index substring match from inputlookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-substring-match-from-inputlookup/m-p/753670#M242769</link>
      <description>&lt;P&gt;Try something like this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your base search | search [| inputlookup yourlookup.csv | eval SIPURI='user-part'."*" | table SIPURI]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is assuming that your lookup table has the field&amp;nbsp; "user-part" which contains partial value which your base search has for field "SIPURI". It would be beneficial if you can share you obfuscated search to get better answer.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2025 17:15:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-substring-match-from-inputlookup/m-p/753670#M242769</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2025-09-26T17:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Index substring match from inputlookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-substring-match-from-inputlookup/m-p/753671#M242770</link>
      <description>&lt;P&gt;Thanks for the quick reply,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt;&amp;nbsp;.&lt;BR /&gt;&lt;BR /&gt;Here is my sanitized search.&amp;nbsp; I think I am doing what you suggested, but it is not working.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="call_data" event_type="sip*" ("STARTED" OR "ENDED") 
[|inputlookup short_duration_results.csv 
| fields sourcenumber
| rex field=sourcenumber "(?&amp;lt;user_part&amp;gt;[^@]+)" 
| dedup user_part
| eval SIPURI=user_part."%" 
| fields - sourcenumber user_part
| format ]
| table
meta
SIPURI
state.state
| rename
meta as direction
SIPURI as sourcenumber
state.state as state
| eval duration_seconds=offsetInMs/1000
| table guid _time timestampStr sourcenumber duration_seconds state
| eval sourcenumber=mvdedup(sourcenumber)
| eval startTime=CASE(state="STARTED",timestampStr)
| eval endTime=CASE(state="ENDED",timestampStr)
| eval endDuration=CASE(state="ENDED",duration_seconds)
| stats values(*) as * by guid
| where endDuration &amp;gt; 120
| table guid sourcenumber startTime endDuration
| sort -startTime&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, again!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2025 17:31:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-substring-match-from-inputlookup/m-p/753671#M242770</guid>
      <dc:creator>sarge338</dc:creator>
      <dc:date>2025-09-26T17:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Index substring match from inputlookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-substring-match-from-inputlookup/m-p/753678#M242772</link>
      <description>&lt;P&gt;You can make it so much easier for volunteers to help if you post sample/mock data (including content/format of lookup) instead of dropping hint fragments about the logic you are following. (Very often SPL is not the most direct way to describe logic, especially if the SPL does not get the desired result.) &amp;nbsp;It would also help greatly if you show results from posted data and explain why it is not as desired unless the difference is painfully obvious. &amp;nbsp;In this case, a phrase like "the search returns no result" is far better than "not working."&lt;/P&gt;&lt;P&gt;Here, I will assume that the search returns no results even though the same index data are used to produce the lookup. &amp;nbsp;Is that what you mean by "not working"? &amp;nbsp;If my speculation is correct, this is a simple matter of wildcard to use. &amp;nbsp;Change the first command to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="call_data" event_type="sip*" ("STARTED" OR "ENDED") 
[|inputlookup short_duration_results.csv 
| fields sourcenumber
| rex field=sourcenumber "(?&amp;lt;user_part&amp;gt;[^@]+)" 
| dedup user_part
| eval SIPURI=user_part."*" 
| fields - sourcenumber user_part
| format ]&lt;/LI-CODE&gt;&lt;P&gt;"%" is used as wildcard only with LIKE operator or like function in evaluation context such as in a where command. &amp;nbsp;Wildcard character in search command is "*".&lt;/P&gt;&lt;P&gt;While changing wildcard character can make the search return results, using subsearch from the lookup may not be the best strategy for such a use case, depending on how large the lookup is.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2025 19:26:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-substring-match-from-inputlookup/m-p/753678#M242772</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2025-09-26T19:26:48Z</dc:date>
    </item>
  </channel>
</rss>

