Reporting

Splunk Challenge - Dropdown option for each feed

aravindp
Explorer

We have built social media sentiment analysis app in splunk, now we need to train our machine learning dataset for product category and sarcasm category. We are reading the indexed data and adding 2 more fields for user input as shown below in the screen shot.

Every time user has to select Tcount to update the other two fields. In case if we have 50 tweets for a day, then everytime user has to do this update for 50 times. Is there a way where we can provide dropdown options each TweetText directly similar to the one in excel spreadsheet updates?

User is expecting to use dropdown for each TweetText and update when they are done. Kindly advise if this is a possible solution.
alt text

Tags (1)
0 Karma

aravindp
Explorer

This is the sample code that needs little changes with respect to date.

  <label>Product Notes - Lookup Updater</label>
  <fieldset submitButton="true" autoRun="true">
    <input type="text" token="Tcount" searchWhenChanged="true">
      <label>Search Tcount:</label>
      <default>%</default>
      <initialValue>%%</initialValue>
    </input>
    <input type="dropdown" token="Sarcasm_Category" searchWhenChanged="false">
      <label>Enter Sarcasm_Category:</label>
      <default>*</default>
      <initialValue>*</initialValue>
      <choice value="True Positive">True Positive</choice>
      <choice value="True Negative">True Negative</choice>
      <choice value="True Neutral">True Neutral</choice>
      <choice value="*">*</choice>
    </input>
    <input type="dropdown" token="Product_Category" searchWhenChanged="false">
      <label>Enter Product_Category:</label>
      <default>*</default>
      <initialValue>*</initialValue>
      <choice value="ApplePay">ApplePay</choice>
      <choice value="ATM">ATM</choice>
      <choice value="ContactCenter">ContactCenter</choice>
      <choice value="EFTPOS">EFTPOS</choice>
      <choice value="InternetBanking">Internet Banking</choice>
      <choice value="PhoneBanking">Phone Banking</choice>
      <choice value="Others">Others</choice>
      <choice value="*">*</choice>
    </input>
    <input type="time" token="time" searchWhenChanged="true">
      <label>Twiiter Time</label>
      <default>
        <earliest>@d</earliest>
        <latest>now</latest>
      </default>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <search>
          <query>index=au_skillmatrix_mssql_dbx  OR index=au_socialmedia* sourcetype=twitter_prod_data | dedup Tcount | eval Time = strptime(AuTime,"%Y-%m-%d %H:%M:%S") |eval DATE = strftime(Time,"%d-%m-%Y %H:%M:%S")
| eval check = "%$Tcount$%" |eval _lock="No"
| eval Sarcasm_Category="$Sarcasm_Category$"  |eval today=strftime(now(),"%Y-%m-%d")  |eval TODAY = strftime(Time,"%Y-%m-%d")
| eval Product_Category="$Product_Category$" |eval _lock = if(check = "%%%","Yes","No")
| table TweetText Sentiment Tcount DATE Sarcasm_Category Product_Category _lock TODAY today
| join [rest /services/authentication/current-context/context | search NOT username="splunk-system-user"
| head 1 | fields username]
| table TweetText Sentiment Tcount DATE Sarcasm_Category Product_Category _lock username TODAY today|where Tcount like "%$Tcount$%" |where _lock= "No" |where TODAY = today
| inputlookup append=true product_notes.csv
| dedup Tcount
| outputlookup product_notes.csv
| table  TweetText Sentiment Tcount DATE Sarcasm_Category Product_Category _lock username |where Tcount like "%$Tcount$%"  
| sort -DATE</query>
            <earliest>@d</earliest>
        <latest>now</latest>
        </search>
                <option name="list.drilldown">full</option>
        <option name="list.wrap">1</option>
        <option name="maxLines">5</option>
        <option name="raw.drilldown">full</option>
        <option name="rowNumbers">true</option>
        <option name="table.drilldown">1</option>
        <option name="table.wrap">1</option>
        <option name="type">list</option>
        <option name="wrap">true</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="count">1000</option>
      </table>
    </panel>
  </row>
</form>
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...