<?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 Error when trying to add token to limit table results in a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Error-when-trying-to-add-token-to-limit-table-results-in-a/m-p/468381#M131885</link>
    <description>&lt;P&gt;I recreated the dashboard using the report search and have the search returning all of the table results. I have an input for the reference number as a text box. The token name is: &lt;STRONG&gt;purchCostReferenceToken&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I want to limit the table results based on this token. This is the search:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; &amp;lt;form&amp;gt;
      &amp;lt;label&amp;gt;Thru Train Dashboard&amp;lt;/label&amp;gt;
      &amp;lt;fieldset submitButton="false" autoRun="true"&amp;gt;
        &amp;lt;input type="text" token="purchCostReferenceToken" searchWhenChanged="true"&amp;gt;
          &amp;lt;label&amp;gt;Enter a TMS Reference Number to Filter Table&amp;lt;/label&amp;gt;
          &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
          &amp;lt;initialValue&amp;gt;*&amp;lt;/initialValue&amp;gt;
        &amp;lt;/input&amp;gt;
      &amp;lt;/fieldset&amp;gt;
      &amp;lt;row&amp;gt;
        &amp;lt;panel&amp;gt;
          &amp;lt;title&amp;gt;Thru Train Data&amp;lt;/title&amp;gt;
          &amp;lt;table&amp;gt;
            &amp;lt;search&amp;gt;
              &amp;lt;query&amp;gt;index=... "&amp;lt;billingMethod&amp;gt;RULE&amp;lt;/billingMethod&amp;gt;" "createMessage MsgSource" | xmlkv | rex max_match=0 "\&amp;lt;purchasedCostTripSegment\&amp;gt;(?P&amp;lt;segment&amp;gt;[^\&amp;lt;]+)" |eval Segments =  mvrange(1,mvcount(mvindex(segment, 0, 2))+1,1) | rex max_match=0 "\&amp;lt;carrier\&amp;gt;(?P&amp;lt;Carriers&amp;gt;[^\&amp;lt;]+)" | rex max_match=0 "\&amp;lt;billingMethod\&amp;gt;(?P&amp;lt;BillingMethod&amp;gt;[^\&amp;lt;]+)" | rex max_match=0 "&amp;lt;purchasedCostTripSegment&amp;gt;[\s\S]*?&amp;lt;origin&amp;gt;\s*&amp;lt;ns2:numberCode&amp;gt;(?P&amp;lt;Origin&amp;gt;\d+)"  | rex max_match=0 "&amp;lt;purchasedCostTripSegment&amp;gt;[\s\S]*?&amp;lt;destination&amp;gt;\s*&amp;lt;ns2:numberCode&amp;gt;(?P&amp;lt;Destination&amp;gt;\d+)" | rex max_match=0 "&amp;lt;purchasedCostTripSegment&amp;gt;[\s\S]*?&amp;lt;stopOff&amp;gt;\s*&amp;lt;ns2:stopOffLocation&amp;gt;\s*&amp;lt;ns2:numberCode&amp;gt;(?P&amp;lt;StopOffLocation&amp;gt;\d+)" | eval Time =_time | convert timeformat="%m-%d-%Y %H:%M:%S" ctime(Time) | table purchCostReference, eventType, Time, Segments, Carriers, BillingMethod, Origin, Destination, StopOffLocation | sort Time&amp;lt;/query&amp;gt;
              &amp;lt;earliest&amp;gt;-30d@d&amp;lt;/earliest&amp;gt;
              &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
            &amp;lt;/search&amp;gt;
            &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
          &amp;lt;/table&amp;gt;
        &amp;lt;/panel&amp;gt;
      &amp;lt;/row&amp;gt;
    &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Where do I add the token to limit the search?&lt;BR /&gt;I tried adding this to the end of the search before the table command:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; ...   | eval Time =_time | convert timeformat="%m-%d-%Y %H:%M:%S" ctime(Time) purchCostReference=$purchCostReferenceToken$ | table purchCostReference, eventType, Time, Segments, Carriers, BillingMethod, Origin, Destination, StopOffLocation | sort Time
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I get an error...&lt;STRONG&gt;error in convert command: the argument purchCostReference- is invalid&lt;/STRONG&gt;&lt;BR /&gt;I would like to add filters in several of the table columns. The purchCostReference value is an extracted field in the search using &lt;STRONG&gt;xmlkv&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jun 2020 18:09:27 GMT</pubDate>
    <dc:creator>3618475</dc:creator>
    <dc:date>2020-06-08T18:09:27Z</dc:date>
    <item>
      <title>Error when trying to add token to limit table results in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-when-trying-to-add-token-to-limit-table-results-in-a/m-p/468381#M131885</link>
      <description>&lt;P&gt;I recreated the dashboard using the report search and have the search returning all of the table results. I have an input for the reference number as a text box. The token name is: &lt;STRONG&gt;purchCostReferenceToken&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I want to limit the table results based on this token. This is the search:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; &amp;lt;form&amp;gt;
      &amp;lt;label&amp;gt;Thru Train Dashboard&amp;lt;/label&amp;gt;
      &amp;lt;fieldset submitButton="false" autoRun="true"&amp;gt;
        &amp;lt;input type="text" token="purchCostReferenceToken" searchWhenChanged="true"&amp;gt;
          &amp;lt;label&amp;gt;Enter a TMS Reference Number to Filter Table&amp;lt;/label&amp;gt;
          &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
          &amp;lt;initialValue&amp;gt;*&amp;lt;/initialValue&amp;gt;
        &amp;lt;/input&amp;gt;
      &amp;lt;/fieldset&amp;gt;
      &amp;lt;row&amp;gt;
        &amp;lt;panel&amp;gt;
          &amp;lt;title&amp;gt;Thru Train Data&amp;lt;/title&amp;gt;
          &amp;lt;table&amp;gt;
            &amp;lt;search&amp;gt;
              &amp;lt;query&amp;gt;index=... "&amp;lt;billingMethod&amp;gt;RULE&amp;lt;/billingMethod&amp;gt;" "createMessage MsgSource" | xmlkv | rex max_match=0 "\&amp;lt;purchasedCostTripSegment\&amp;gt;(?P&amp;lt;segment&amp;gt;[^\&amp;lt;]+)" |eval Segments =  mvrange(1,mvcount(mvindex(segment, 0, 2))+1,1) | rex max_match=0 "\&amp;lt;carrier\&amp;gt;(?P&amp;lt;Carriers&amp;gt;[^\&amp;lt;]+)" | rex max_match=0 "\&amp;lt;billingMethod\&amp;gt;(?P&amp;lt;BillingMethod&amp;gt;[^\&amp;lt;]+)" | rex max_match=0 "&amp;lt;purchasedCostTripSegment&amp;gt;[\s\S]*?&amp;lt;origin&amp;gt;\s*&amp;lt;ns2:numberCode&amp;gt;(?P&amp;lt;Origin&amp;gt;\d+)"  | rex max_match=0 "&amp;lt;purchasedCostTripSegment&amp;gt;[\s\S]*?&amp;lt;destination&amp;gt;\s*&amp;lt;ns2:numberCode&amp;gt;(?P&amp;lt;Destination&amp;gt;\d+)" | rex max_match=0 "&amp;lt;purchasedCostTripSegment&amp;gt;[\s\S]*?&amp;lt;stopOff&amp;gt;\s*&amp;lt;ns2:stopOffLocation&amp;gt;\s*&amp;lt;ns2:numberCode&amp;gt;(?P&amp;lt;StopOffLocation&amp;gt;\d+)" | eval Time =_time | convert timeformat="%m-%d-%Y %H:%M:%S" ctime(Time) | table purchCostReference, eventType, Time, Segments, Carriers, BillingMethod, Origin, Destination, StopOffLocation | sort Time&amp;lt;/query&amp;gt;
              &amp;lt;earliest&amp;gt;-30d@d&amp;lt;/earliest&amp;gt;
              &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
            &amp;lt;/search&amp;gt;
            &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
          &amp;lt;/table&amp;gt;
        &amp;lt;/panel&amp;gt;
      &amp;lt;/row&amp;gt;
    &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Where do I add the token to limit the search?&lt;BR /&gt;I tried adding this to the end of the search before the table command:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; ...   | eval Time =_time | convert timeformat="%m-%d-%Y %H:%M:%S" ctime(Time) purchCostReference=$purchCostReferenceToken$ | table purchCostReference, eventType, Time, Segments, Carriers, BillingMethod, Origin, Destination, StopOffLocation | sort Time
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I get an error...&lt;STRONG&gt;error in convert command: the argument purchCostReference- is invalid&lt;/STRONG&gt;&lt;BR /&gt;I would like to add filters in several of the table columns. The purchCostReference value is an extracted field in the search using &lt;STRONG&gt;xmlkv&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 18:09:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-when-trying-to-add-token-to-limit-table-results-in-a/m-p/468381#M131885</guid>
      <dc:creator>3618475</dc:creator>
      <dc:date>2020-06-08T18:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error when trying to add token to limit table results in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-when-trying-to-add-token-to-limit-table-results-in-a/m-p/468382#M131886</link>
      <description>&lt;P&gt;If the tokenized fields are automatically extracted then include the tokens in the base search.  For example, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=... "&amp;lt;billingMethod&amp;gt;RULE&amp;lt;/billingMethod&amp;gt;" "createMessage MsgSource" purchCostReference=$purchCostReferenceToken$ | xmlkv ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the fields aren't automatically extracted then put the tokens after the field extraction.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | xmlkv | rex max_match=0 "\&amp;lt;purchasedCostTripSegment\&amp;gt;(?P&amp;lt;segment&amp;gt;[^\&amp;lt;]+)" |search  segment=$purchCostReferenceToken$ | eval Segments = ....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Jun 2020 17:02:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-when-trying-to-add-token-to-limit-table-results-in-a/m-p/468382#M131886</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-06-02T17:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error when trying to add token to limit table results in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-when-trying-to-add-token-to-limit-table-results-in-a/m-p/468383#M131887</link>
      <description>&lt;P&gt;Thanks! That worked&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 18:29:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-when-trying-to-add-token-to-limit-table-results-in-a/m-p/468383#M131887</guid>
      <dc:creator>3618475</dc:creator>
      <dc:date>2020-06-02T18:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error when trying to add token to limit table results in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-when-trying-to-add-token-to-limit-table-results-in-a/m-p/468384#M131888</link>
      <description>&lt;P&gt;In my case I just had to add "$purchCostReferenceToken$" to the query&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 19:55:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-when-trying-to-add-token-to-limit-table-results-in-a/m-p/468384#M131888</guid>
      <dc:creator>3618475</dc:creator>
      <dc:date>2020-06-02T19:55:24Z</dc:date>
    </item>
  </channel>
</rss>

