<?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 pass values from CSV file to the main search in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-pass-values-from-CSV-file-to-the-main-search/m-p/671773#M112581</link>
    <description>Have you try to switch "where" to "search" on your SPL?</description>
    <pubDate>Wed, 13 Dec 2023 17:32:10 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2023-12-13T17:32:10Z</dc:date>
    <item>
      <title>How to pass values from CSV file to the main search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-pass-values-from-CSV-file-to-the-main-search/m-p/671771#M112580</link>
      <description>&lt;P&gt;I have this search query and working fine.&lt;/P&gt;&lt;P&gt;index="dynatrace" sourcetype="dynatrace:usersession"&lt;BR /&gt;| spath output=user_actions path="userActions{}" | stats count by user_actions | spath output=pp_user_action_application input=user_actions path=application | where pp_user_action_application="test" | spath output=pp_user_action_name input=user_actions path=name&lt;BR /&gt;&lt;FONT color="#FF9900"&gt;| where pp_user_action_name in ("test.aspx")&lt;/FONT&gt;&lt;BR /&gt;| spath output=pp_user_action_response input=user_actions path=visuallyCompleteTime | eval pp_user_action_name=substr(pp_user_action_name,0,150)&lt;BR /&gt;| eventstats avg(pp_user_action_response) AS "Avg_today" by pp_user_action_name&lt;BR /&gt;| stats count(pp_user_action_response) As "Today_Calls",perc90(pp_user_action_response) AS "Perc90_today" by pp_user_action_name Avg_today&lt;BR /&gt;| eval Perc90_today=round(Perc90_today/1000,2)| eval Avg_today=round(Avg_today/1000,2)&lt;BR /&gt;| table pp_user_action_name,Today_Calls,Avg_today,Perc90_today&lt;/P&gt;&lt;P&gt;PFA screenshot for the results.&lt;/P&gt;&lt;P&gt;Now i am trying to pass the pp_user_action_name value from the &lt;STRONG&gt;test.csv&lt;/STRONG&gt; file and not getting any results&amp;nbsp;&lt;/P&gt;&lt;P&gt;index="dynatrace" sourcetype="dynatrace:usersession"&lt;BR /&gt;| spath output=user_actions path="userActions{}" | stats count by user_actions | spath output=pp_user_action_application input=user_actions path=application | where pp_user_action_application="test" | spath output=pp_user_action_name input=user_actions path=name&lt;BR /&gt;&lt;FONT color="#FF9900"&gt;&lt;STRONG&gt;| where pp_user_action_name in ([| inputlookup test.csv])&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;| spath output=pp_user_action_response input=user_actions path=visuallyCompleteTime | eval pp_user_action_name=substr(pp_user_action_name,0,150)&lt;BR /&gt;| eventstats avg(pp_user_action_response) AS "Avg_today" by pp_user_action_name&lt;BR /&gt;| stats count(pp_user_action_response) As "Today_Calls",perc90(pp_user_action_response) AS "Perc90_today" by pp_user_action_name Avg_today&lt;BR /&gt;| eval Perc90_today=round(Perc90_today/1000,2)| eval Avg_today=round(Avg_today/1000,2)&lt;BR /&gt;| table pp_user_action_name,Today_Calls,Avg_today,Perc90_today&lt;/P&gt;&lt;P&gt;How to fix this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 17:27:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-pass-values-from-CSV-file-to-the-main-search/m-p/671771#M112580</guid>
      <dc:creator>sabari80</dc:creator>
      <dc:date>2023-12-13T17:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values from CSV file to the main search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-pass-values-from-CSV-file-to-the-main-search/m-p/671773#M112581</link>
      <description>Have you try to switch "where" to "search" on your SPL?</description>
      <pubDate>Wed, 13 Dec 2023 17:32:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-pass-values-from-CSV-file-to-the-main-search/m-p/671773#M112581</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-12-13T17:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values from CSV file to the main search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-pass-values-from-CSV-file-to-the-main-search/m-p/671779#M112582</link>
      <description>&lt;P&gt;Yes i have tried with &lt;STRONG&gt;Search&lt;/STRONG&gt;&amp;nbsp;command as well, but no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index="dynatrace" sourcetype="dynatrace:usersession"&lt;BR /&gt;| spath output=user_actions path="userActions{}" | stats count by user_actions | spath output=pp_user_action_application input=user_actions path=application | where pp_user_action_application="test" | spath output=pp_user_action_name input=user_actions path=name&lt;BR /&gt;&lt;STRONG&gt;| search pp_user_action_name in ([| inputlookup test.csv])&lt;/STRONG&gt;&lt;BR /&gt;| spath output=pp_user_action_response input=user_actions path=visuallyCompleteTime | eval pp_user_action_name=substr(pp_user_action_name,0,150)&lt;BR /&gt;| eventstats avg(pp_user_action_response) AS "Avg_today" by pp_user_action_name&lt;BR /&gt;| stats count(pp_user_action_response) As "Today_Calls",perc90(pp_user_action_response) AS "Perc90_today" by pp_user_action_name Avg_today&lt;BR /&gt;| eval Perc90_today=round(Perc90_today/1000,2)| eval Avg_today=round(Avg_today/1000,2)&lt;BR /&gt;| table pp_user_action_name,Today_Calls,Avg_today,Perc90_today&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 17:58:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-pass-values-from-CSV-file-to-the-main-search/m-p/671779#M112582</guid>
      <dc:creator>sabari80</dc:creator>
      <dc:date>2023-12-13T17:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values from CSV file to the main search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-pass-values-from-CSV-file-to-the-main-search/m-p/671783#M112583</link>
      <description>&lt;P&gt;You may be better off formatting your search command to be like&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search [ | inputlookup test.csv | fields + &amp;lt;filter_field&amp;gt; | rename &amp;lt;filter_field&amp;gt; as pp_user_action_name | format ]&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;You can see here that the format command formats the output of the subsearch as a valid search string that gets used in the parent search. Example of subsearch output:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dtburrows3_0-1702491125358.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28497i689A8247B526945F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dtburrows3_0-1702491125358.png" alt="dtburrows3_0-1702491125358.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Example of this used on a local Splunk instance:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dtburrows3_1-1702491183776.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28498i2B2E06D4EC2C7938/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dtburrows3_1-1702491183776.png" alt="dtburrows3_1-1702491183776.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 18:13:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-pass-values-from-CSV-file-to-the-main-search/m-p/671783#M112583</guid>
      <dc:creator>dtburrows3</dc:creator>
      <dc:date>2023-12-13T18:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass values from CSV file to the main search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-pass-values-from-CSV-file-to-the-main-search/m-p/671805#M112585</link>
      <description>&lt;P&gt;The odd thing about the &lt;STRONG&gt;IN&lt;/STRONG&gt;&amp;nbsp;command is that it is not consistent across &lt;STRONG&gt;search&lt;/STRONG&gt; and &lt;STRONG&gt;where&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;If using SEARCH you need to put the IN in capital letters, not lowercase, so technically you need to do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search pp_user_action_name IN ...&lt;/LI-CODE&gt;&lt;P&gt;However, as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263242"&gt;@dtburrows3&lt;/a&gt;&amp;nbsp;suggests, you are better off using the standard subsearch syntax for doing IN style searching, i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search [ | inputlookup test.csv 
           | fields YOUR_CSV_FIELD 
           | rename YOUR_CSV_FIELD as pp_user_action_name ]&lt;/LI-CODE&gt;&lt;P&gt;You don't actually need the format statement as there is an implicit format statement applied to the subsearch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 21:47:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-pass-values-from-CSV-file-to-the-main-search/m-p/671805#M112585</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-12-13T21:47:02Z</dc:date>
    </item>
  </channel>
</rss>

