<?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 edit a text input from a dashboard? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-a-text-input-from-a-dashboard/m-p/290532#M18442</link>
    <description>&lt;P&gt;test_mac_address&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="text" token="field1"&amp;gt;
  &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
&amp;lt;/input&amp;gt;


&amp;lt;panel&amp;gt;
  &amp;lt;event&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index=* host=* sourcetype="*" mac=$field1$&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;1498276800&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;1498363200&amp;lt;/latest&amp;gt;
    &amp;lt;/search&amp;gt;
  &amp;lt;/event&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 14:46:00 GMT</pubDate>
    <dc:creator>sbbadri</dc:creator>
    <dc:date>2020-09-29T14:46:00Z</dc:date>
    <item>
      <title>How to edit a text input from a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-a-text-input-from-a-dashboard/m-p/290530#M18440</link>
      <description>&lt;P&gt;Hello fellow Splunkers! First post here on the forums.&lt;/P&gt;

&lt;P&gt;I've been looking around and trying to do this particular task for over a week but I feel I've hit a wall. I want to be able to edit a text input from a dashboard where  user will enter a MAC address with colons, but in search use that same MAC address but without colons. Reason being that the user will get the MAC addresses from  &lt;CODE&gt;sourcetype=linux_syslog&lt;/CODE&gt; where the field with the MAC address will have have the value with colons: &lt;CODE&gt;macAddr="a1:b2:c3:d4:e5:f6"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;That MAC address will then be used in  &lt;CODE&gt;sourcetype=radius&lt;/CODE&gt; where the field with the MAC address does NOT have colons:  &lt;CODE&gt;radMacAddr="a1b2c3d4e5f6"&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I currently use the token of  &lt;CODE&gt;$mac_address$&lt;/CODE&gt; for the inputted text and use rex to take out the colons: &lt;CODE&gt;| eval rex_macaddr="$mac_address$" | rex mode=sed field=rex_macaddr "s/://g"&lt;/CODE&gt;. This creates the field &lt;CODE&gt;rex_macaddr&lt;/CODE&gt; with the inputted MAC address to appear without colons (progress for me!). &lt;/P&gt;

&lt;P&gt;This is where I hit a wall.  I feel I'm going about this the wrong way entirely. When doing it the way in the paragraph above, there will be 2 fields will with same values in &lt;CODE&gt;sourcetype=radius&lt;/CODE&gt;.&lt;BR /&gt;
1. &lt;CODE&gt;radMacAddr="a1b2c3d4e5f6"&lt;/CODE&gt; - the original field I need to search through.&lt;BR /&gt;
2. &lt;CODE&gt;rex_macaddr="a1b2c3d4e5f6"&lt;/CODE&gt; - the newly created field from the user text input.&lt;/P&gt;

&lt;P&gt;As you can see, this doesn't really help me unless I can create a new token based on the single result of &lt;CODE&gt;rex_macaddr&lt;/CODE&gt;.  If possible I wouldn't mind trying it out, but I feel I need to reach out and ask more experienced Splunkers on the best way to go about solving my problem.&lt;/P&gt;

&lt;P&gt;Thank you all greatly!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 23:08:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-a-text-input-from-a-dashboard/m-p/290530#M18440</guid>
      <dc:creator>zinaut</dc:creator>
      <dc:date>2017-07-05T23:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a text input from a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-a-text-input-from-a-dashboard/m-p/290531#M18441</link>
      <description>&lt;P&gt;Probably a ton of different ways to do this.  But one option could be to create a new token when the mac address is entered in the text box, and use that token for your radius search.  So, something like this inside your textbox input definition.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;change&amp;gt;
    &amp;lt;eval token="t_mac_no_colon"&amp;gt;replace($value$,":","")&amp;lt;/eval&amp;gt;
&amp;lt;/change&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then use the new $t_mac_no_colon$ token when searching your radius logs.  Something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_radius_index sourcetype=your_radius_sourcetype radMacAddr="$t_mac_no_colon$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:45:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-a-text-input-from-a-dashboard/m-p/290531#M18441</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2020-09-29T14:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a text input from a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-a-text-input-from-a-dashboard/m-p/290532#M18442</link>
      <description>&lt;P&gt;test_mac_address&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="text" token="field1"&amp;gt;
  &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
&amp;lt;/input&amp;gt;


&amp;lt;panel&amp;gt;
  &amp;lt;event&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index=* host=* sourcetype="*" mac=$field1$&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;1498276800&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;1498363200&amp;lt;/latest&amp;gt;
    &amp;lt;/search&amp;gt;
  &amp;lt;/event&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:46:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-a-text-input-from-a-dashboard/m-p/290532#M18442</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2020-09-29T14:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a text input from a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-a-text-input-from-a-dashboard/m-p/290533#M18443</link>
      <description>&lt;P&gt;Thank you very much maciep! It worked out perfectly. I honestly didn't know about &lt;CODE&gt;&amp;lt;change&amp;gt;&lt;/CODE&gt; in simpleXML. I'll add it to my arsenal of knowledge now. My thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 17:21:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-a-text-input-from-a-dashboard/m-p/290533#M18443</guid>
      <dc:creator>zinaut</dc:creator>
      <dc:date>2017-07-06T17:21:02Z</dc:date>
    </item>
  </channel>
</rss>

