<?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: Invalid term on the left hand side in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437534#M28864</link>
    <description>&lt;P&gt;Line 15 is probably the culprit:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "user=(?&amp;lt;user&amp;gt;[a-zA-Z0-9]*\s)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You'll need to encode the less-than and greater-than characters:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "user=(?&amp;amp;lt;user&amp;amp;gt;[a-zA-Z0-9]*\s)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 09 Aug 2019 15:58:47 GMT</pubDate>
    <dc:creator>jpolvino</dc:creator>
    <dc:date>2019-08-09T15:58:47Z</dc:date>
    <item>
      <title>Invalid term on the left hand side</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437533#M28863</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I have the results from a dashboard dropdown feeding another dropdown; and I receive this error.&lt;BR /&gt;
There is also a Timepicker input.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Error in 'search' command: Unable to parse the search: Comparator '=' has an invalid term on the left hand side: host=host.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Here is the first input.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;input type="dropdown" token="hostName"&amp;gt;
      &amp;lt;label&amp;gt;Host Name&amp;lt;/label&amp;gt;
      &amp;lt;prefix&amp;gt;host="&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;"&amp;lt;/suffix&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt; 
      &amp;lt;fieldForLabel&amp;gt;host&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;host&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;
          index=test_linuxevents 
          AND host!="*splunk*" 
          AND earliest=$Selected_Time_Range.earliest$ AND latest=$Selected_Time_Range.latest$
          | stats count by host
        &amp;lt;/query&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is the second input, which generates the error.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;input type="dropdown" token="userId"&amp;gt;
      &amp;lt;label&amp;gt;user&amp;lt;/label&amp;gt;
      &amp;lt;prefix&amp;gt;user="&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;"&amp;lt;/suffix&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;user&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;user&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
         &amp;lt;query&amp;gt;
          index=test_linuxevents 
            AND host=$hostName$ 
            AND sourcetype="Unix:UserAccounts" 
            AND earliest=$Selected_Time_Range.earliest$ AND latest=$Selected_Time_Range.latest$
           | rex field=_raw "user=(?&amp;lt;user&amp;gt;[a-zA-Z0-9]*\s)"
           | dedup user
        &amp;lt;/query&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In second input, I am using host=$hostName$. This is similar to what Splunk Dashboard Examples App has coded with &lt;STRONG&gt;user=$username$&lt;/STRONG&gt;.&lt;BR /&gt;
&lt;EM&gt;/simple_xml_examples/simple_form_cascading/editxml?form.username=&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;fieldset autoRun="true"&amp;gt;
        &amp;lt;input type="dropdown" token="username"&amp;gt;
            &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
            &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
            &amp;lt;fieldForLabel&amp;gt;user&amp;lt;/fieldForLabel&amp;gt;
            &amp;lt;fieldForValue&amp;gt;user&amp;lt;/fieldForValue&amp;gt;
            &amp;lt;search&amp;gt;
                &amp;lt;query&amp;gt;index=_internal | stats count by user&amp;lt;/query&amp;gt;
                &amp;lt;earliest&amp;gt;-24h&amp;lt;/earliest&amp;gt;
                &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
            &amp;lt;/search&amp;gt;
        &amp;lt;/input&amp;gt;
        &amp;lt;input type="radio" token="source"&amp;gt;
            &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
            &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
            &amp;lt;fieldForLabel&amp;gt;sourcetype&amp;lt;/fieldForLabel&amp;gt;
            &amp;lt;fieldForValue&amp;gt;sourcetype&amp;lt;/fieldForValue&amp;gt;
            &amp;lt;search&amp;gt;
                &amp;lt;query&amp;gt;index=_internal user=$username$| stats count by sourcetype&amp;lt;/query&amp;gt;
                &amp;lt;earliest&amp;gt;-24h&amp;lt;/earliest&amp;gt;
                &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
            &amp;lt;/search&amp;gt;
        &amp;lt;/input&amp;gt;
    &amp;lt;/fieldset&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What am I missing?&lt;BR /&gt;
Thanks in advance for your help.&lt;BR /&gt;
God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:40:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437533#M28863</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-09-30T01:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid term on the left hand side</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437534#M28864</link>
      <description>&lt;P&gt;Line 15 is probably the culprit:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "user=(?&amp;lt;user&amp;gt;[a-zA-Z0-9]*\s)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You'll need to encode the less-than and greater-than characters:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "user=(?&amp;amp;lt;user&amp;amp;gt;[a-zA-Z0-9]*\s)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Aug 2019 15:58:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437534#M28864</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2019-08-09T15:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid term on the left hand side</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437535#M28865</link>
      <description>&lt;P&gt;@jpolvino &lt;BR /&gt;
Actually that is what the XML code is. When I cut pasted it, the original XML was from the dashboard and I overwrote the  with the SPL I wasa testing from the search screen (I forgot to change the&amp;lt;&amp;gt; in this post). It is current in my XML.&lt;BR /&gt;
Thanks and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 17:50:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437535#M28865</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2019-08-09T17:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid term on the left hand side</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437536#M28866</link>
      <description>&lt;P&gt;Ok, then try removing the AND commands from line 14:&lt;BR /&gt;
AND earliest=$Selected_Time_Range.earliest$ AND latest=$Selected_Time_Range.latest$&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:40:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437536#M28866</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2020-09-30T01:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid term on the left hand side</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437537#M28867</link>
      <description>&lt;P&gt;@jpolvino&lt;BR /&gt;
Not sure what removing the ANDs will do. These are tokens from the Timepicker.&lt;BR /&gt;
Thanks and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 19:53:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437537#M28867</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2019-08-14T19:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid term on the left hand side</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437538#M28868</link>
      <description>&lt;P&gt;Closing this post.&lt;BR /&gt;
Thanks and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 13:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437538#M28868</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2019-09-26T13:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid term on the left hand side</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437539#M28869</link>
      <description>&lt;P&gt;So this is all working for you now? If so, come back and post your own answer and tell us what you did to fix it and click &lt;CODE&gt;Accept&lt;/CODE&gt; on your answer to close the questions officially/fully.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2019 23:10:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437539#M28869</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-10T23:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid term on the left hand side</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437540#M28870</link>
      <description>&lt;P&gt;@woodcock &lt;BR /&gt;
Apologies to the Answers Forum; got dragged in various directions.&lt;/P&gt;

&lt;P&gt;Removed the &lt;EM&gt;prefix&lt;/EM&gt;, &lt;EM&gt;suffix&lt;/EM&gt;, &lt;EM&gt;default&lt;/EM&gt; and &lt;EM&gt;choice value&lt;/EM&gt; tags.&lt;BR /&gt;
Changed the &lt;EM&gt;fieldForLabel&lt;/EM&gt; and &lt;EM&gt;fieldForValue&lt;/EM&gt; tags from &lt;STRONG&gt;user&lt;/STRONG&gt; to &lt;STRONG&gt;acct&lt;/STRONG&gt;. This is used later as the last command in the query.&lt;BR /&gt;
Changed from &lt;STRONG&gt;sourcetype=Unix:UserAccounts&lt;/STRONG&gt; to &lt;STRONG&gt;source=/var/log/audit/audit.log&lt;/STRONG&gt;. The list of users is more accurate for the time frame. &lt;BR /&gt;
Replaced the &lt;STRONG&gt;| rex&lt;/STRONG&gt; and &lt;STRONG&gt;| dedup&lt;/STRONG&gt; commands in my original code, with &lt;STRONG&gt;| stats count by "acct"&lt;/STRONG&gt;. No exactly sure why this would work though. I would think it should be &lt;STRONG&gt;|stats value(acct)&lt;/STRONG&gt;. &lt;/P&gt;

&lt;P&gt;Lastly, moved the time from in the query to the end of the search tag.&lt;/P&gt;

&lt;P&gt;Here is my code that stopped the error from occurring. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;input type="dropdown" token="userId" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;user&amp;lt;/label&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;acct&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;acct&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;
          index="test_linuxevents"
            AND source="/var/log/audit/audit.log"
            AND host=$hostName$ 
          | stats count by "acct"
        &amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;$Selected_Time_Range.earliest$&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;$Selected_Time_Range.latest$&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since it accomplished what I needed, I will accept this as the answer. However, as mentioned above, not quite sure why.&lt;/P&gt;

&lt;P&gt;Thanks and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 13:34:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Invalid-term-on-the-left-hand-side/m-p/437540#M28870</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2019-11-12T13:34:01Z</dc:date>
    </item>
  </channel>
</rss>

