Setting the table name in telegraf mqtt_consumer plugin - telegraf

I am using telegraf to write mqtt messages to questdb. Currently, all my mqtt messages are written into the table "mqtt_consumer" by default. How can I change the name, where the mqtt_consumer is writing the data into the db?
[inputs.mqtt_consumer.tags]
destinationdb = "mqtt_data"
That doesn't work. I cant find an option for that. It could be that the table name needs to be set in the output plugin but I can't find any option for that. This is my output plugin:
[[outputs.socket_writer]]
adress = "tcp://localhost:9000"

I believe questdb uses the metric name to determine what table it writes to. The metric name is determined by the input name in most cases.
You can rename a metric via:
[[processors.rename]]
[[processors.rename.replace]]
measurement = "mqtt_consumer"
dest = "mqtt_data"
Edit:
I forgot about the name_override option. You can use that to change the name of the measurement directly. See it listed in the configuration options docs. You could set this for every mqtt_consumer input plugin to get distinct measurement names.

Related

Import pdf files from API into rows in Power Bi

I have a Power Bi Dashboard I've made that pulls its Data from a Redcap Database using an API. It looks like this, with mostly Text in the various columns:
What I'd love to do is make it so that thee fields circled in red were real files that could be clicked and downloaded. I know that the API allows me to pull files from it. I've used R with code like this (that individually mentions what record and field I want):
library(REDCapR)
redcap_download_file_oneshot( redcap_uri="https://redcap.company.org/redcap/api/", token="################", record="1", field='full_protocol_attachment_t_v2', event = "", repeat_instrument = NULL, repeat_instance = NULL, verbose = TRUE, config_options = NULL, overwrite = TRUE )
To individually download files one at a time. The problem is twofold:
If I were to use R, I have no idea how to automate that snippet of code for every row I may pull from the database (and if there are new rows)
My understanding of PowerBi is that if I do use R, it makes refreshing the data harder when the report is published online. Right now given all the data just comes from an api directly into PowerBi, I don't have to setup any fancy permissions or gateways to have automated refreshes.
So my question is: is there a way to do this directly within PowerBi? Like a calculated column or something that would pull a particular records file based on what row it was in?
The only thing you can do in native PBI is have a URL which when clicked will open the destination for you. Can you create a full url for the file download?

Crystal Report same parameter in different commands

I have to use same parameter(paramCompanyId) in both the commands.
I will be setting the parameter value on code.
crystalReportDocument.SetParameterValue("paramCompanyId",LoggedInMembersCompanyID);
Note:
command:crmleadsbycustomer => retrieves report data
command:crmopportunity => dynamic filter dropdown data
Issues:
If I use the same parameter it keeps on prompting without executing
the report.
I don’t want user to enter parameter on prompt so I am setting up in
code.
I don’t want to use separate parameters for each command (this way
works fine)
Edit parameter and change the list of values to "Dynamic" and under "Value", choose the companyID column from command "crmopportunity".
Create a new formula: {?paramCompanyId}=companyID column from command "crmleadsbycustomer".
In the Record Select Expert, use this formula to filter the records.

The function get_option() does not pull a value from my DB

I have an option value in the wp_options table as such: option_name . twitter_feed . and the value is there in the options value column. But when I run the following in my code, I get false:
$tf = get_option('twitter_feed');
var_dump($tf);
I have access to my DB and I can see that there is an option named twitter_feed and there is a value. The value starts with a format of:
a:20:{i:0;O:8:"stdClass":28:{s:10:"created_at";s:30:"Tue Sep 19 22:16:26 +0000 2017";s:2:"id";i:910266359799525376;s:6:"id_str";s:18:"910266359799525376";s:4:"text";s:70:"We can't wait for the Grand Opening on Oct 19!'
Does the format that is saved in the DB has anything to do with not being able to pull the value? I would assume I would at least get an error and not false.
I also have a facebook_feed value that works. It is also an option in the wp_options table of facebook_feed and that value starts with a format of:
a:25:{i:0;a:6:{s:7:"message";s:412:""Our scientific and research-based training and programs were devised to help
How can I access the value of my twitter_feed value?
This looks like serialized data. See:
http://php.net/manual/en/function.unserialize.php
Let me know if this helps.
I tried this:
$ff = get_option('twitter_feed');
$ff = unserialize($ff);
var_dump($ff);
the same false. Since I have access to the DB, I grabbed the original twitter feed value and save it to a text editor and then copied the facebook feed value and placed it in the twitter_feed options value. Still FALSE. This makes no sense. AS I have a facebook_feed option and a twitter_feed option both with the same value in my wp_options table and only the facebook_feed works. I have deleted all of the transients in wp_options table thinking this might be an issue but no luck.
Any other ideas?
Well after many hours I finally got it working. I inherited this WP site and it seems to have been coded by someone who just learned OOP. Got to give them props for trying but Many issues. So I created a brand new function to consume the Twitter API and save the new feed in my twitter_feed options value and that worked. Not sure if the data was corrupted, but when I would try to pull the original data out I would receive a FALSE value. Now with the new data feed saved, it works.
Thanks Paul for the suggestion.

What are the possible values for the duplicaterecords attribute in armx files

I'm looking to automate an import to remedy ARS 8.1, and I'm 99.9999% there... I just need to change what the import does with duplicate records, as everything else seems to be working exactly as desired.
In remedy armx files (mapping file for the dataimporttool), there is a <datahandling> node with a duplicaterecords attribute, the only documentation I can find on it mentions the value GEN_NEW_ID, which would logically map to the "Generate New ID for Duplicate Records" option in the GUI import tool. I need the value to logically map to the "Update Old Record with New Record's Data" GUI option (both of these options and the other three possible options are described on the Defining Data Import preferences page in BMC docs.
Other than that one page (Importing in...), and the several local versions of the exact same paragraph in all the remedy documentation I have, Google turns up nothing. Please tell me someone has this information somewhere!
By saving .armx files from the GUI, I have found the following options and values for the duplicaterecords attribute in the <datahandling> tag.
Title Value in .armx file
Generate New ID for All Records GEN_NEW_ID
Reject Duplicate Records DUP_ERROR
Generate New ID for Duplicate Records DUP_NEW_ID
Replace Old Record with New Record DUP_OVERWRITE
Update Old Record with New Record's Data DUP_MERGE

Changing the Admin Theme in Drupal 6 Directly in Database

I'd like to restore the default admin theme in Drupal 6 via the database. Anyone know where this is stored?
Btw, there is a great answer describing how to change your site's public theme in the database here ...I just could not get it to update my admin theme.
List of themes you can find in {system} table, filter by type = theme, there you can set status = 1
Default theme you can find in {variable} table, filter by name = theme_default, change it to you theme name, as it is written in system table (for example, garland, not Garland).
After this clear cache table.
Follow these steps via the db:
{system} table, filter by type=theme
set status=1
{variable} table, filter by
name=theme_default change it to you
theme name, as it is written in
system table
{variable} table, filter by
name=admin_theme change it to you
theme name, as it is written in
system table. Do not skip this step.
truncate cache
Login to your phpMyAdmin, click on SQL tab and run:
UPDATE system SET status=1 WHERE name = 'garland';
UPDATE variable SET value='s:7:"garland"' WHERE name = 'theme_default';
TRUNCATE cache;
Note that you may need to add prefix to your tables
Thanks to https://drupal.org/node/200774
If you're editing the variables in PHPMyAdmin, remember that you're editing a serialized value. This means that the value you're editing looks something like this: 's:7:"garland"'.
If you just changed "garland" to "marvin" that would change the number of letters in the serialized value from seven to six.
You'd need to change 's:7:"garland"' to 's:6:"marvin"'
That is, you'd need to count the number of letters in your new theme, and update the number following s: accordingly.

Resources